We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e783a23 commit e3c4a5bCopy full SHA for e3c4a5b
Lib/test/test_capi.py
@@ -825,6 +825,20 @@ def callback():
825
t.start()
826
t.join()
827
828
+ @threading_helper.reap_threads
829
+ def test_gilstate_ensure_no_deadlock(self):
830
+ # See https://github.com/python/cpython/issues/96071
831
+ code = textwrap.dedent(f"""
832
+ import _testcapi
833
+
834
+ def callback():
835
+ print('callback called')
836
837
+ _testcapi._test_thread_state(callback)
838
+ """)
839
+ ret = assert_python_ok('-X', 'tracemalloc', '-c', code)
840
+ self.assertIn(b'callback called', ret.out)
841
842
843
class Test_testcapi(unittest.TestCase):
844
locals().update((name, getattr(_testcapi, name))
0 commit comments