summaryrefslogtreecommitdiffstats
path: root/Modules/_tracemalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_tracemalloc.c')
-rw-r--r--Modules/_tracemalloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index 226a473..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;
@@ -439,10 +441,6 @@ tracemalloc_add_trace(void *ptr, size_t size)
trace_t trace;
int res;
-#ifdef WITH_THREAD
- assert(PyGILState_Check());
-#endif
-
traceback = traceback_new();
if (traceback == NULL)
return -1;
@@ -991,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);