diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-01 14:02:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 14:02:40 (GMT) |
commit | 3026cad59b87751a9215111776cac8e819458fce (patch) | |
tree | b994018d331ca9f01f58ebd1a3d05c4f3aa1cdc0 /Lib/test/test_capi.py | |
parent | db64f12e4deda2abbafb6d2bd5c06762fca991ff (diff) | |
download | cpython-3026cad59b87751a9215111776cac8e819458fce.zip cpython-3026cad59b87751a9215111776cac8e819458fce.tar.gz cpython-3026cad59b87751a9215111776cac8e819458fce.tar.bz2 |
bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)
Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r-- | Lib/test/test_capi.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 44693b8..5b8b9f6 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -68,7 +68,10 @@ class CAPITest(unittest.TestCase): self.assertTrue(err.rstrip().startswith( b'Fatal Python error: ' b'PyThreadState_Get: ' - b'current thread state is NULL (released GIL?)')) + b'the function must be called with the GIL held, ' + b'but the GIL is released ' + b'(the current Python thread state is NULL)'), + err) def test_memoryview_from_NULL_pointer(self): self.assertRaises(ValueError, _testcapi.make_memoryview_from_NULL_pointer) |