summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-08-19 00:32:54 (GMT)
committerGitHub <noreply@github.com>2017-08-19 00:32:54 (GMT)
commitb50e7683acac36ff16e6c6c2c32d9a15e46b5174 (patch)
tree8ab544a2d9232a6b8438e087b9ab847800be84fe /Lib/test/test_threading.py
parent3e866dfaecaa4eb8f98c12782d2488f681225c37 (diff)
downloadcpython-b50e7683acac36ff16e6c6c2c32d9a15e46b5174.zip
cpython-b50e7683acac36ff16e6c6c2c32d9a15e46b5174.tar.gz
cpython-b50e7683acac36ff16e6c6c2c32d9a15e46b5174.tar.bz2
bpo-31234: test_threading: fix ref cycle (#3150) (#3152)
test_bare_raise_in_brand_new_thread() now explicitly breaks a reference cycle to not leak a dangling thread. (cherry picked from commit 3d284c081fc3042036adfe1bf2ce92c34d743b0b)
Diffstat (limited to 'Lib/test/test_threading.py')
-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 0db0288..162a72e 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):