A neat trick i found in the python tutorial:
If you need to determine whether an exception was raised but don't intend to handle it, a simpler form of the raise statement allows you to re-raise the exception:
... raise NameError, 'HiThere'
... except NameError:
... print 'An exception flew by!'
An exception flew by!
Traceback (most recent call last):
", line 2, in ?
For more read the Errors and Exceptions section