We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 216ccac commit 079baeeCopy full SHA for 079baee
Lib/test/test_capi.py
@@ -1053,6 +1053,21 @@ def callback():
1053
t.start()
1054
t.join()
1055
1056
+ @threading_helper.reap_threads
1057
+ @threading_helper.requires_working_threading()
1058
+ def test_gilstate_ensure_no_deadlock(self):
1059
+ # See https://github.com/python/cpython/issues/96071
1060
+ code = textwrap.dedent(f"""
1061
+ import _testcapi
1062
+
1063
+ def callback():
1064
+ print('callback called')
1065
1066
+ _testcapi._test_thread_state(callback)
1067
+ """)
1068
+ ret = assert_python_ok('-X', 'tracemalloc', '-c', code)
1069
+ self.assertIn(b'callback called', ret.out)
1070
1071
1072
class Test_testcapi(unittest.TestCase):
1073
locals().update((name, getattr(_testcapi, name))
0 commit comments