mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
bpo-36829: test_threading: Fix a ref cycle (GH-13752)
This commit is contained in:
parent
aca273e240
commit
cdce0574d0
1 changed files with 5 additions and 1 deletions
|
|
@ -1140,7 +1140,11 @@ class ExceptHookTests(BaseTestCase):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue