summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-11-08 22:07:37 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-11-08 22:07:37 (GMT)
commit50c6bdb1d6f5344fcaa772c6a1a37c09bbe55bf6 (patch)
treed13b58927b5b67465558756843e551830728beba /Lib/doctest.py
parente0b855fac96e858934e9792c6d04bfb2f35b3b9d (diff)
downloadcpython-50c6bdb1d6f5344fcaa772c6a1a37c09bbe55bf6.zip
cpython-50c6bdb1d6f5344fcaa772c6a1a37c09bbe55bf6.tar.gz
cpython-50c6bdb1d6f5344fcaa772c6a1a37c09bbe55bf6.tar.bz2
test_doctest.py test_pdb_set_trace_nested(): A new test from Jim Fulton
showing that doctest's pdb.set_trace() support was dramatically broken. doctest.py _OutputRedirectingPdb.trace_dispatch(): Return a local trace function instead of (implicitly) None. Else interaction with pdb was bizarre, noticing only 'call' events. Amazingly, the existing set_trace() tests didn't care.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index a8162f3..fb4f01b 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -105,8 +105,6 @@ from StringIO import StringIO
warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
__name__, 0)
-real_pdb_set_trace = pdb.set_trace
-
# There are 4 basic classes:
# - Example: a <source, want> pair, plus an intra-docstring line number.
# - DocTest: a collection of examples, parsed from a docstring, plus
@@ -350,9 +348,10 @@ class _OutputRedirectingPdb(pdb.Pdb):
save_stdout = sys.stdout
sys.stdout = self.__out
# Call Pdb's trace dispatch method.
- pdb.Pdb.trace_dispatch(self, *args)
+ result = pdb.Pdb.trace_dispatch(self, *args)
# Restore stdout.
sys.stdout = save_stdout
+ return result
# [XX] Normalize with respect to os.path.pardir?
def _module_relative_path(module, path):