]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport Tim's checkin 1.12:
authorThomas Wouters <thomas@python.org>
Wed, 27 Jun 2001 15:07:17 +0000 (15:07 +0000)
committerThomas Wouters <thomas@python.org>
Wed, 27 Jun 2001 15:07:17 +0000 (15:07 +0000)
doctest systematically leaked memory when handling an exception in an
example (an obvious trackback cycle).  Repaired.

Lib/doctest.py

index 270e3087e752a5a613887f5898c021311855bebb..c52a2955a7a08f265457ed4ef8e771160f7e81c8 100644 (file)
@@ -500,7 +500,7 @@ def _run_examples_inner(out, fakeout, examples, globs, verbose, name):
                 # Only compare exception type and value - the rest of
                 # the traceback isn't necessary.
                 want = want.split('\n')[-2] + '\n'
-                exc_type, exc_val, exc_tb = sys.exc_info()
+                exc_type, exc_val = sys.exc_info()[:2]
                 got = traceback.format_exception_only(exc_type, exc_val)[0]
                 state = OK
             else: