Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update test_capi
  • Loading branch information
vstinner committed Jun 16, 2022
commit 0ff9861a7c07c9550ffc3fa6f4352c3f1e51a145
17 changes: 9 additions & 8 deletions Lib/test/test_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ def test_no_FatalError_infinite_loop(self):
'import _testcapi;'
'_testcapi.crash_no_current_thread()'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stderr=subprocess.PIPE,
text=True)
(out, err) = p.communicate()
self.assertEqual(out, b'')
self.assertEqual(out, '')
# This used to cause an infinite loop.
self.assertTrue(err.rstrip().startswith(
b'Fatal Python error: '
b'PyThreadState_Get: '
b'the function must be called with the GIL held, '
b'but the GIL is released '
b'(the current Python thread state is NULL)'),
msg = ("Fatal Python error: PyThreadState_Get: "
"the function must be called with the GIL held, "
"after Python initialization and before Python finalization, "
"but the GIL is released "
"(the current Python thread state is NULL)")
self.assertTrue(err.rstrip().startswith(msg),
err)

def test_memoryview_from_NULL_pointer(self):
Expand Down