[Python-checkins] cpython: _tracemalloc: filename cannot be NULL

victor.stinner python-checkins at python.org
Tue Mar 15 09:28:31 EDT 2016


https://hg.python.org/cpython/rev/0f251e1b877d
changeset:   100544:0f251e1b877d
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Mar 15 14:28:04 2016 +0100
summary:
  _tracemalloc: filename cannot be NULL

files:
  Modules/_tracemalloc.c |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -65,6 +65,8 @@
 _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 @@
     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);
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list