diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 0f3ac555c2d..800d26f71b2 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1069,6 +1069,8 @@ class ThreadingExceptionTests(BaseTestCase): thread.join() self.assertIsNotNone(thread.exc) self.assertIsInstance(thread.exc, RuntimeError) + # explicitly break the reference cycle to not leak a dangling thread + thread.exc = None class TimerTests(BaseTestCase):