Skip to content

Commit

Permalink
bpo-36829: test_threading: Fix a ref cycle (GH-13752)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Jun 2, 2019
1 parent aca273e commit cdce057
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,11 @@ def test_excepthook_thread_None(self):
raise ValueError("bug")
except Exception as exc:
args = threading.ExceptHookArgs([*sys.exc_info(), None])
threading.excepthook(args)
try:
threading.excepthook(args)
finally:
# Explicitly break a reference cycle
args = None

stderr = stderr.getvalue().strip()
self.assertIn(f'Exception in thread {threading.get_ident()}:\n', stderr)
Expand Down

0 comments on commit cdce057

Please sign in to comment.