469,610 Members | 1,761 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Catching a non-Exception object (KeyboardInterrupt)

Hi,

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?

Thanks,
Michael
Feb 4 '08 #1
2 1919
Michael Goerz <an*******@8439.e4ward.comwrites:
when I try to catch ctrl+c with

except KeyboardInterrupt:

pychecker tells me

Catching a non-Exception object (KeyboardInterrupt)
Looks like a pychecker bug. It might be confused by KeyboardInterrupt
being derived not from Exception, but from BaseException.
Feb 4 '08 #2
Hrvoje Niksic <hn*****@xemacs.orgwrote:
Michael Goerz <an*******@8439.e4ward.comwrites:
>when I try to catch ctrl+c with

except KeyboardInterrupt:

pychecker tells me

Catching a non-Exception object (KeyboardInterrupt)

Looks like a pychecker bug. It might be confused by KeyboardInterrupt
being derived not from Exception, but from BaseException.
There's a patch for this see:
https://thomas.apestaart.org/thomas/...t=diff&new=938
but it looks like pychecker isn't being maintained because nothing has
changed for more than 2 years.
Feb 4 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Olli Piepponen | last post: by
2 posts views Thread by fred | last post: by
20 posts views Thread by BigMan | last post: by
5 posts views Thread by Philip Hölzenspies | last post: by
5 posts views Thread by lord.zoltar | last post: by
9 posts views Thread by Steve Folly | last post: by
42 posts views Thread by thomas.mertes | last post: by
39 posts views Thread by mathieu | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.