diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-11-13 14:14:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-13 14:14:58 (GMT) |
commit | f966e5397ed8f5c42c185223fc9b4d750a678d02 (patch) | |
tree | f5cb478c7f28e95c498c46678c43864c499cfa24 /Lib/test/test_capi.py | |
parent | 474eedfb3d1b6fecbd749f36bf4a987cf4a00b44 (diff) | |
download | cpython-f966e5397ed8f5c42c185223fc9b4d750a678d02.zip cpython-f966e5397ed8f5c42c185223fc9b4d750a678d02.tar.gz cpython-f966e5397ed8f5c42c185223fc9b4d750a678d02.tar.bz2 |
bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510)
If tracemalloc is not tracing Python memory allocations,
_PyMem_DumpTraceback() now suggests to enable tracemalloc
to get the traceback where the memory block has been allocated.
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r-- | Lib/test/test_capi.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index b3600eb..3c8c3f0 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -486,6 +486,8 @@ class PyMemDebugTests(unittest.TestCase): r" The block was made by call #[0-9]+ to debug malloc/realloc.\n" r" Data at p: cb cb cb .*\n" r"\n" + r"Enable tracemalloc to get the memory block allocation traceback\n" + r"\n" r"Fatal Python error: bad trailing pad byte") regex = regex.format(ptr=self.PTR_REGEX) regex = re.compile(regex, flags=re.DOTALL) @@ -500,6 +502,8 @@ class PyMemDebugTests(unittest.TestCase): r" The block was made by call #[0-9]+ to debug malloc/realloc.\n" r" Data at p: cb cb cb .*\n" 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") regex = regex.format(ptr=self.PTR_REGEX) self.assertRegex(out, regex) |