Skip to content

Commit

Permalink
bpo-31234: test_threading: fix ref cycle (#3150)
Browse files Browse the repository at this point in the history
test_bare_raise_in_brand_new_thread() now explicitly breaks a
reference cycle to not leak a dangling thread.
  • Loading branch information
vstinner committed Aug 18, 2017
1 parent a32e405 commit 3d284c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,8 @@ def run(self):
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):

Expand Down

0 comments on commit 3d284c0

Please sign in to comment.