Catching a non-Exception object (KeyboardInterrupt)
gagsl-py2 at yahoo.com.ar
Mon Feb 4 15:34:01 CET 2008
En Mon, 04 Feb 2008 11:53:52 -0200, Michael Goerz
<answer654 at 8439.e4ward.com> escribi�:
> when I try to catch ctrl+c with
> except KeyboardInterrupt:
> pychecker tells me
> Catching a non-Exception object (KeyboardInterrupt)
> It works fine, but the message indicates that it's not completely clean.
> How should I write the exception correctly?
Your code is right; the latest official release of pychecker doesn't
support Python 2.5.
The exception hierarchy has changed a little, now you have BaseException
-> Exception -> all standard exceptions. KeyboardInterrupt and SystemExit
are now direct subclasses of BaseException, not of Exception.
According to the changelog  the development version does support 2.5
More information about the Python-list