Skip Montanaro <montanaro@tttech.com> writes: > [KeyboardInterrupt] Parenthetically, could someone explain why this doesn't work[1]: >>> import signal >>> def interrupt(signum, frame): ... sys.exit(1) ... >>> signal.signal(signal.SIGINT, interrupt) <built-in function default_int_handler> >>> ^C KeyboardInterrupt >>> ^C KeyboardInterrupt >>> ^C KeyboardInterrupt and yet: >>> def testit(): ... signal.signal(signal.SIGINT, interrupt) ... while 1: ... pass ... >>> testit() ^C[mwh@starship mwh]$ I think I hate readline. Cheers, M. [1] Actually I know, on thinking about it, but it still sucks. Is this worth working around? -- You have run into the classic Dmachine problem: your machine has become occupied by a malevolent spirit. Replacing hardware or software will not fix this - you need an exorcist. -- Tim Bradshaw, comp.lang.lisp
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4