Message46072
| 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:54 | admin | link | issue960406 messages |
| 2007年08月23日 15:37:54 | admin | create |
|