summaryrefslogtreecommitdiffstats
path: root/Modules/_tracemalloc.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-15 13:28:04 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-15 13:28:04 (GMT)
commit7105e9f3de801ce50e24fcdfbdd450858e28a0fd (patch)
tree90bc46c59797249f38443b8bf0fccab3f7448ad1 /Modules/_tracemalloc.c
parent32eb840a42ec0e131daac48d43aa35290e72571e (diff)
downloadcpython-7105e9f3de801ce50e24fcdfbdd450858e28a0fd.zip
cpython-7105e9f3de801ce50e24fcdfbdd450858e28a0fd.tar.gz
cpython-7105e9f3de801ce50e24fcdfbdd450858e28a0fd.tar.bz2
_tracemalloc: filename cannot be NULL
Diffstat (limited to 'Modules/_tracemalloc.c')
-rw-r--r--Modules/_tracemalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index d62e682..2eb4dca 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -65,6 +65,8 @@ __attribute__((packed))
_declspec(align(4))
#endif
{
+ /* filename cannot be NULL: "<unknown>" is used if the Python frame
+ filename is NULL */
PyObject *filename;
int lineno;
} frame_t;
@@ -987,8 +989,6 @@ frame_to_pyobject(frame_t *frame)
if (frame_obj == NULL)
return NULL;
- if (frame->filename == NULL)
- frame->filename = Py_None;
Py_INCREF(frame->filename);
PyTuple_SET_ITEM(frame_obj, 0, frame->filename);