Created
May 2, 2011 09:20
-
-
Save simonklee/951347 to your computer and use it in GitHub Desktop.
ipdb without colors
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 sys | |
from IPython.Debugger import Pdb | |
from IPython.Shell import IPShell | |
shell = IPShell(argv=['']) | |
def set_trace(): | |
Pdb().set_trace(sys._getframe().f_back) | |
def post_mortem(tb): | |
p = Pdb() | |
p.reset() | |
if tb is None: | |
return | |
while tb.tb_next is not None: | |
tb = tb.tb_next | |
p.interaction(tb.tb_frame, tb) | |
def pm(): | |
post_mortem(sys.last_traceback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment