summaryrefslogtreecommitdiffstats
path: root/Objects/bytearrayobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-15 21:22:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-15 21:22:13 (GMT)
commit0611c26a58a937dace420691e797fbea21db619b (patch)
tree20f6c60f778a2e999d299b3b015f01d83a10eb4d /Objects/bytearrayobject.c
parentaf584a02a5dee4250e904ff75d22359aee9c2d70 (diff)
downloadcpython-0611c26a58a937dace420691e797fbea21db619b.zip
cpython-0611c26a58a937dace420691e797fbea21db619b.tar.gz
cpython-0611c26a58a937dace420691e797fbea21db619b.tar.bz2
On memory error, dump the memory block traceback
Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a memory block was allocated on memory block. Use the tracemalloc module to get the traceback.
Diffstat (limited to 'Objects/bytearrayobject.c')
-rw-r--r--Objects/bytearrayobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 9e8ba39..67ae7d9 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2820,6 +2820,7 @@ bytearray_hex(PyBytesObject *self)
{
char* argbuf = PyByteArray_AS_STRING(self);
Py_ssize_t arglen = PyByteArray_GET_SIZE(self);
+ PyByteArray_AS_STRING(self)[arglen+1] = 2;
return _Py_strhex(argbuf, arglen);
}