diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-02 23:08:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-02 23:08:41 +0200 |
commit | cdce0574d03005e27b843fc110c54c99c7a76412 (patch) | |
tree | 8896e4aef432f89cfdc249549daf72dcfa6820b8 /Lib/test/test_threading.py | |
parent | aca273e2401ca3151e15e984f400233b7f255e15 (diff) | |
download | cpython-git-cdce0574d03005e27b843fc110c54c99c7a76412.tar.gz |
bpo-36829: test_threading: Fix a ref cycle (GH-13752)
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 8c8cc128b0..6ac4ea9623 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -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) |