From: Victor Stinner Date: Fri, 18 Aug 2017 23:54:42 +0000 (+0200) Subject: bpo-31234: test_threading: fix ref cycle (#3150) X-Git-Tag: v3.7.0a1~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d284c081fc3042036adfe1bf2ce92c34d743b0b;p=python bpo-31234: test_threading: fix ref cycle (#3150) test_bare_raise_in_brand_new_thread() now explicitly breaks a reference cycle to not leak a dangling thread. --- diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 0f3ac555c2..800d26f71b 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):