Created
February 7, 2014 01:40
-
-
Save mahmoudimus/8856049 to your computer and use it in GitHub Desktop.
post-mortem
This file contains 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
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