def debug(self):
        """
        Launch a postmortem debug shell at the site of the error.
        """
        try:
            __import__('ipdb').post_mortem(self.traceback)
        except ImportError:
            __import__('pdb').post_mortem(self.traceback)
Launch a postmortem debug shell at the site of the error.