Skip to content

Commit cdce057

Browse files
authored
bpo-36829: test_threading: Fix a ref cycle (GH-13752)
1 parent aca273e commit cdce057

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_threading.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,11 @@ def test_excepthook_thread_None(self):
11401140
raise ValueError("bug")
11411141
except Exception as exc:
11421142
args = threading.ExceptHookArgs([*sys.exc_info(), None])
1143-
threading.excepthook(args)
1143+
try:
1144+
threading.excepthook(args)
1145+
finally:
1146+
# Explicitly break a reference cycle
1147+
args = None
11441148

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

0 commit comments

Comments
 (0)