summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-08-18 23:54:42 (GMT)
committerGitHub <noreply@github.com>2017-08-18 23:54:42 (GMT)
commit3d284c081fc3042036adfe1bf2ce92c34d743b0b (patch)
tree9a70166392ce12397cc08bf5e617bdf51f512717
parenta32e40561a24de373d1c5a437a8aa329758ba8e4 (diff)
downloadcpython-3d284c081fc3042036adfe1bf2ce92c34d743b0b.zip
cpython-3d284c081fc3042036adfe1bf2ce92c34d743b0b.tar.gz
cpython-3d284c081fc3042036adfe1bf2ce92c34d743b0b.tar.bz2
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.
-rw-r--r--Lib/test/test_threading.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 0f3ac55..800d26f 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):