A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-November/018420.html below:

[Python-Dev] Proposal - KeyboardInterrupt should inherit directly from Exception

[Python-Dev] Proposal - KeyboardInterrupt should inherit directly from Exception [Python-Dev] Proposal - KeyboardInterrupt should inherit directly from ExceptionMichael Hudson mwh@starship.python.net
Thu, 08 Nov 2001 05:24:53 -0500
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