From 7105e9f3de801ce50e24fcdfbdd450858e28a0fd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 15 Mar 2016 14:28:04 +0100 Subject: [PATCH] _tracemalloc: filename cannot be NULL --- Modules/_tracemalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index d62e68254df..2eb4dcad444 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -65,6 +65,8 @@ __attribute__((packed)) _declspec(align(4)) #endif { + /* filename cannot be NULL: "" 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);