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 "", line 2, in ? __main__.Foo: <__main__.Foo instance at 0x00B35FA8>