[issue4938] Pdb cannot access doctest source in postmortem

Jonathan report at bugs.python.org
Sat May 9 16:58:19 CEST 2009


Jonathan <jonathan.cervidae at gmail.com> added the comment:

#!/usr/bin/env python
# This does what you want. Change pydb for pdb if you prefer it.
import pydb
import doctest
import sys
sys.excepthook = pydb.exception_hook
try:
    doctest.testfile("story.txt",verbose=False,raise_on_error=True)
except doctest.UnexpectedException, failure:
    pass
exc_info = failure.exc_info
raise exc_info[0], exc_info[1], exc_info[2]

----------
nosy: +jonathan.cervidae

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4938>
_______________________________________


More information about the Python-bugs-list mailing list