Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5428

Re: connect SIGINT to custom interrupt handler

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 <rosuav@gmail.com>
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 <slrnisvove.dj0.chris@scheingraber.no-ip.org>
References <slrnisv835.b74.chris@scheingraber.no-ip.org> <pan.2011.05.15.13.08.22.15000@nowhere.com> <slrnisvove.dj0.chris@scheingraber.no-ip.org>
Date Mon, 16 May 2011 01:30:10 +1000
Subject Re: connect SIGINT to custom interrupt handler
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1595.1305473419.9059.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Mon, May 16, 2011 at 12:32 AM, Christoph Scheingraber <chris@spam.org> wrote:
> 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:
>    File "/usr/local/bin/obspysod", line 586, in interrupt_handler
>    signal.siginterrupt(signal.SIGINT, False)
>    AttributeError: '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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

connect SIGINT to custom interrupt handler Christoph Scheingraber <chris@spam.org> - 2011-05-15 09:44 +0000
  Re: connect SIGINT to custom interrupt handler Christoph Scheingraber <chris@spam.org> - 2011-05-15 14:32 +0000
    Re: connect SIGINT to custom interrupt handler Chris Angelico <rosuav@gmail.com> - 2011-05-16 01:30 +1000
    Re: connect SIGINT to custom interrupt handler Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-15 17:43 +0200
      Re: connect SIGINT to custom interrupt handler Christoph Scheingraber <spam@scheingraber.net> - 2011-05-15 17:05 +0000
        Re: connect SIGINT to custom interrupt handler Nobody <nobody@nowhere.com> - 2011-05-16 03:28 +0100
        Re: connect SIGINT to custom interrupt handler Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-20 09:38 +0200
    Re: connect SIGINT to custom interrupt handler Nobody <nobody@nowhere.com> - 2011-05-16 03:53 +0100
  Re: connect SIGINT to custom interrupt handler Nobody <nobody@nowhere.com> - 2011-05-15 14:08 +0100

csiph-web