summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-06-11 15:59:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-06-11 15:59:43 (GMT)
commiteec3d7137929611b98dd593cd2f122cd91b723b2 (patch)
tree42721419d4fe3f53961ecfd7c1dea3224188ae40 /Lib/doctest.py
parente8465f2b413174084fcc2dc4cd7a53122c62ce4b (diff)
downloadcpython-eec3d7137929611b98dd593cd2f122cd91b723b2.zip
cpython-eec3d7137929611b98dd593cd2f122cd91b723b2.tar.gz
cpython-eec3d7137929611b98dd593cd2f122cd91b723b2.tar.bz2
#3021: Antoine Pitrou's Lexical exception handlers
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index dad8333..74be21e 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -1242,10 +1242,9 @@ class DocTestRunner:
# The example raised an exception: check if it was expected.
else:
- exc_info = sys.exc_info()
- exc_msg = traceback.format_exception_only(*exc_info[:2])[-1]
+ exc_msg = traceback.format_exception_only(*exception[:2])[-1]
if not quiet:
- got += _exception_traceback(exc_info)
+ got += _exception_traceback(exception)
# If `example.exc_msg` is None, then we weren't expecting
# an exception.
@@ -1275,7 +1274,7 @@ class DocTestRunner:
elif outcome is BOOM:
if not quiet:
self.report_unexpected_exception(out, test, example,
- exc_info)
+ exception)
failures += 1
else:
assert False, ("unknown outcome", outcome)