This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author langmead
Recipients
Date 2004-06-19.03:04:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=119306

I'm not sure if the current behavior should be maintained or not, but it 
looks like to me that the readline module has always generated a 
KeyboardInterrupt, regardless of whether SIGINT has been overridden. 
This is a bit odd though. It causes the SIGINT handling to change 
depending on whether or not you are at the top level interpreter's 
prompt.

wantarray% cat /tmp/foo.py 
import signal

def foo(sig, frame):
  print "caught foo"

signal.signal(signal.SIGINT, foo)


wantarray% python -i /tmp/foo.py
>>> foo
<function foo at 0x61430>
>>> ^C
KeyboardInterrupt
>>> while 1:
...   pass
... 
^Ccaught foo
^Ccaught foo
^Ccaught foo
^Ccaught foo
^\zsh: quit       python -i /tmp/foo.py
History
Date User Action Args
2007-08-23 15:37:54adminlinkissue960406 messages
2007-08-23 15:37:54admincreate