Skip to content

Instantly share code, notes, and snippets.

@bretthoerner
Created August 4, 2011 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bretthoerner/1125832 to your computer and use it in GitHub Desktop.
Save bretthoerner/1125832 to your computer and use it in GitHub Desktop.
ipdb for IPython 0.11
import sys
from IPython.core.debugger import Pdb
from IPython.core import ipapi
def set_trace():
ip = ipapi.get()
def_colors = ip.colors
Pdb(def_colors).set_trace(sys._getframe().f_back)
def post_mortem(tb):
ip = ipapi.get()
def_colors = ip.colors
p = Pdb(def_colors)
p.reset()
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