Message46072
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
|
|
Date |
User |
Action |
Args |
2007-08-23 15:37:54 | admin | link | issue960406 messages |
2007-08-23 15:37:54 | admin | create | |
|