diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 0db028864d2..162a72ea03f 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1066,6 +1066,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):