Created
August 4, 2011 18:21
-
-
Save bretthoerner/1125832 to your computer and use it in GitHub Desktop.
ipdb for IPython 0.11
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.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