Last active
August 16, 2016 10:39
-
-
Save davidalbertonogueira/4b0e04a0fd9424b9c5c29be2262ae61c to your computer and use it in GitHub Desktop.
Grab python error and start a debug session
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
import os | |
import sys | |
import pdb | |
import traceback | |
try: | |
your code here | |
except: | |
type, value, tb = sys.exc_info() | |
traceback.print_exc() | |
pdb.post_mortem(tb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For starting a debug session on a certain if clause:
if clause:
import pdb
import traceback
traceback.print_exc()
pdb.set_trace()