Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
#
# This code sample shows (what I hope to be) the right way to reraise an exception in the
# situation where you have to perform some cleanup before reraising.
#
cleaned_up = False
def raiser():
raise RuntimeError("this should be reported at line 10")