Skip to content

Instantly share code, notes, and snippets.

@mahmoudimus
Created February 7, 2014 01:40
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 mahmoudimus/8856049 to your computer and use it in GitHub Desktop.
Save mahmoudimus/8856049 to your computer and use it in GitHub Desktop.
post-mortem
try:
func()
except SystemExit:
raise
except:
logger.exception("Uncaught exception! Whooops! DEBUG MODE MOTHAFUCKA")
if sys.stdin.isatty() and not disable_pdb:
try:
from ipdb import post_mortem
except ImportError:
from pdb import post_mortem
_type, _value, traceback = sys.exc_info()
post_mortem(traceback)
else:
exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment