Skip to content

Instantly share code, notes, and snippets.

@simonklee
Created May 2, 2011 09:20
Show Gist options
  • Save simonklee/951347 to your computer and use it in GitHub Desktop.
Save simonklee/951347 to your computer and use it in GitHub Desktop.
ipdb without colors
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