'Launch a postmortem debug shell at the site of the error'

def debug(self):

    try:
        __import__('ipdb').post_mortem(self.traceback)
    except ImportError:
        __import__('pdb').post_mortem(self.traceback)
