Skip to content

Instantly share code, notes, and snippets.

@cocagne
Created November 16, 2012 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocagne/4088489 to your computer and use it in GitHub Desktop.
Save cocagne/4088489 to your computer and use it in GitHub Desktop.
Python decorator for printing exception tracebacks
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