Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77f2d50

Browse files
committed
doctest systematically leaked memory when handling an exception in an
example (an obvious trackback cycle). Repaired. Bugfix candidate.
1 parent b2bc6a9 commit 77f2d50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def _run_examples_inner(out, fakeout, examples, globs, verbose, name):
500500
# Only compare exception type and value - the rest of
501501
# the traceback isn't necessary.
502502
want = want.split('\n')[-2] + '\n'
503-
exc_type, exc_val, exc_tb = sys.exc_info()
503+
exc_type, exc_val = sys.exc_info()[:2]
504504
got = traceback.format_exception_only(exc_type, exc_val)[-1]
505505
state = OK
506506
else:

0 commit comments

Comments
 (0)