Created
November 16, 2012 16:02
-
-
Save cocagne/4088489 to your computer and use it in GitHub Desktop.
Python decorator for printing exception tracebacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tback(fn): | |
def wrapit(*args, **kwargs): | |
try: | |
return fn(*args, **kwargs) | |
except Exception: | |
import traceback | |
traceback.print_exc() | |
raise | |
return wrapit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment