summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_capi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r--Lib/test/test_capi.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index e65973c..ff18a21 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -61,8 +61,8 @@ class CAPITest(unittest.TestCase):
self.assertEqual(out, b'')
# This used to cause an infinite loop.
self.assertTrue(err.rstrip().startswith(
- b'Fatal Python error:'
- b' PyThreadState_Get: no current thread'))
+ b'Fatal Python error: '
+ b'PyThreadState_Get: no current thread'))
def test_memoryview_from_NULL_pointer(self):
self.assertRaises(ValueError, _testcapi.make_memoryview_from_NULL_pointer)
@@ -197,7 +197,8 @@ class CAPITest(unittest.TestCase):
""")
rc, out, err = assert_python_failure('-c', code)
self.assertRegex(err.replace(b'\r', b''),
- br'Fatal Python error: a function returned NULL '
+ br'Fatal Python error: _Py_CheckFunctionResult: '
+ br'a function returned NULL '
br'without setting an error\n'
br'Python runtime state: initialized\n'
br'SystemError: <built-in function '
@@ -225,8 +226,9 @@ class CAPITest(unittest.TestCase):
""")
rc, out, err = assert_python_failure('-c', code)
self.assertRegex(err.replace(b'\r', b''),
- br'Fatal Python error: a function returned a '
- br'result with an error set\n'
+ br'Fatal Python error: _Py_CheckFunctionResult: '
+ br'a function returned a result '
+ br'with an error set\n'
br'Python runtime state: initialized\n'
br'ValueError\n'
br'\n'
@@ -668,7 +670,7 @@ class PyMemDebugTests(unittest.TestCase):
r"\n"
r"Enable tracemalloc to get the memory block allocation traceback\n"
r"\n"
- r"Fatal Python error: bad trailing pad byte")
+ r"Fatal Python error: _PyMem_DebugRawFree: bad trailing pad byte")
regex = regex.format(ptr=self.PTR_REGEX)
regex = re.compile(regex, flags=re.DOTALL)
self.assertRegex(out, regex)
@@ -684,14 +686,14 @@ class PyMemDebugTests(unittest.TestCase):
r"\n"
r"Enable tracemalloc to get the memory block allocation traceback\n"
r"\n"
- r"Fatal Python error: bad ID: Allocated using API 'm', verified using API 'r'\n")
+ r"Fatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API 'm', verified using API 'r'\n")
regex = regex.format(ptr=self.PTR_REGEX)
self.assertRegex(out, regex)
def check_malloc_without_gil(self, code):
out = self.check(code)
- expected = ('Fatal Python error: Python memory allocator called '
- 'without holding the GIL')
+ expected = ('Fatal Python error: _PyMem_DebugMalloc: '
+ 'Python memory allocator called without holding the GIL')
self.assertIn(expected, out)
def test_pymem_malloc_without_gil(self):