Ian Bicking: the old part of his blog

Re: Good catch all exceptions

footnote: "except Exception" doesn't really catch all exceptions:

>>> class Foo:
...     pass
>>> try:
...     raise Foo
... except Exception, e:
...     print "got it"
Traceback (most recent call last):
  File "<stdin>", line 2, in ?
__main__.Foo: <__main__.Foo instance at 0x00B35FA8>
Comment on Good catch all exceptions
by Fredrik


Were people talking about fixing that, i.e., disallowing exceptions that weren't subclasses of Exception? (Except string exceptions, which are a separate special case.)
# Ian Bicking

In Python 3000, sure.  I don't see how you could possibly
change this before that...
# Fredrik

Really? What kind of crazy/annoying people make alternate exception hierarchies that don't subclass from Exception? There's no good reason for it, and it's really easy to fix if you have done it.
# Ian Bicking