Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'int': 0.05; 'parameter': 0.05; 'function,': 0.07; 'attribute': 0.09; 'namespace': 0.09; 'def': 0.13; 'am,': 0.14; 'wrote:': 0.14; "'int'": 0.16; 'false)': 0.16; 'result:': 0.16; '16,': 0.16; 'header:In-Reply-To:1': 0.22; 'mon,': 0.22; 'problem?': 0.23; 'putting': 0.26; 'chris': 0.27; 'object': 0.27; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.28; "skip:' 10": 0.32; 'to:addr:python-list': 0.32; 'using': 0.34; 'there': 0.35; 'module.': 0.35; 'error.': 0.36; 'received:209.85': 0.37; 'skip:\xa0 30': 0.38; 'received:google.com': 0.38; 'skip:" 20': 0.38; '8bit%:6': 0.39; 'skip:s 30': 0.39; 'to:addr:python.org': 0.39; 'could': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'results': 0.61; '2011': 0.62; 'below': 0.63; 'here.': 0.68; '12:32': 0.84; 'masking': 0.84; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 0.84; 'subject:connect': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=miSh+wRCyzph5HMSBDyyPoI2Wf3bR+5Xuz1pdtMFxNI=; b=GBqhMKHGz6V70zWNkdY1xh0qLGSDMGgLT8D1BFu18Z1MSWYOynKrFawyU4Va654A6D Bj7t3vkJi6RaykdUZ5QqmkSaspgSY2mmDa4LQT54TaP8xVkW0YaK5bA0dgYgvVCGp+Ln 7NNIaHWELub8U5IbYKe1LGBvNSh8OxOxSCL+E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SNvg82HbMJ2tfhtJ2aMfgnhXc4aWoj7olkZU5/ax7Cf3pbBBa9WLmt2pSLuCnhFKoG Ty/TWeMW4DII9w3SsBFY3Vkyt/h2i+c6FqR5NbTqCA0VwLvVHNgthJwjk7O9C+sj3i5D 4DTdBBhRHQA0s9RZgkQ+nZiaDUE8idfDnC89Q= MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 16 May 2011 01:30:10 +1000 Subject: Re: connect SIGINT to custom interrupt handler From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305473419 news.xs4all.nl 41114 [::ffff:82.94.164.166]:43427 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5428 On Mon, May 16, 2011 at 12:32 AM, Christoph Scheingraber w= rote: > I now have signal.siginterrupt(signal.SIGINT, False) in the line > below signal.signal(signal.SIGINT, interrupt_handler) > > Unfortunately, pressing ^c still results in the same interrupt error. I > also tried putting signal.siginterrupt into the interrupt_handler > function, which gave an interesting result: > =A0 =A0File "/usr/local/bin/obspysod", line 586, in interrupt_handler > =A0 =A0signal.siginterrupt(signal.SIGINT, False) > =A0 =A0AttributeError: 'int' object has no attribute 'siginterrupt' > > Could there be a namespace problem? def interrupt_handler(signal, frame): You're using 'signal' as a parameter here. The local int is masking the global module. Chris Angelico