KeybordInterrupts and friends
robert
no-spam at no-spam-no-spam.com
Wed Apr 26 07:57:36 EDT 2006
aurelien.campeas at free.fr wrote:
> Hello,
>
> I have a problem with the following code fragment :
>
> --------------------
> import sys
>
> while True:
> try:
> raw_input()
> except EOFError:
> print "C-d"
> except KeyboardInterrupt:
> print "C-c"
> --------------------
>
> The following behaviour seems bogus to me :
>
> auc at musca:~$ python test.py
> C-c
> C-c
> C-d
> C-d
> Traceback (most recent call last):
> File "test.py", line 5, in ?
> raw_input()
> KeyboardInterrupt
>
> The crash happens when I type C-c another time (always *after* atleast
> one C-d has been issued).
>
> What's wrong ? My expectations ? CPython (2.3 and 2.4 on debian exhibit
> the same problem).
> Is this a FAQ ?
maybe consider signal.signal(signal.SIGINT,...
-robert
More information about the Python-list
mailing list