What is the actual type of "interrupted system call"?
jeanmichel at sequans.com
Wed Jun 10 11:05:46 CEST 2009
>> exceptions.EOFError exceptions.ReferenceError exceptions.ZeroDivisionError
>> exceptions.NotImplementedError exceptions.UnicodeError exceptions.__str__
> Is there a single parent exception to all those? Or should I just
> write it as:
> catch Exception:
You're right, Exception is the parent of (almost) all exceptions.
I wouldn't advise writing such block catching all exceptions, it makes
error tracking quite difficult. However if you don't know the type of
exception involved in a particular case, you can write
except Exception, excInstance:
If you know how to trigger the exception, it should print the class name
of the exception, along with its attributes. It will help you then write
a more focused except clause.
More information about the Python-list