Created
November 15, 2012 17:33
-
-
Save akaptur/4079971 to your computer and use it in GitHub Desktop.
simple pdb traceback
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
import pdb | |
x = 0 | |
while True: | |
pdb.set_trace() | |
y = "line of code not triggering an error" | |
x += 1 | |
assert x != 3 | |
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
Traceback (most recent call last): | |
File "minimal_pdb_traceback.py", line 7, in <module> | |
y = "line of code not triggering an error" | |
AssertionError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this code from the command line (python pdb_traceback.py). The set_trace() will launch the debugger. I hit 'c' each time I land on the breakpoint. After three passes, the program exits with the AssertionError and I see the traceback above, pointing to the wrong line of code.