Commit cdce0574 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-36829: test_threading: Fix a ref cycle (GH-13752)

parent aca273e2
......@@ -1140,7 +1140,11 @@ class ExceptHookTests(BaseTestCase):
raise ValueError("bug")
except Exception as exc:
args = threading.ExceptHookArgs([*sys.exc_info(), None])
threading.excepthook(args)
try:
threading.excepthook(args)
finally:
# Explicitly break a reference cycle
args = None
stderr = stderr.getvalue().strip()
self.assertIn(f'Exception in thread {threading.get_ident()}:\n', stderr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment