mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
_tracemalloc: filename cannot be NULL
This commit is contained in:
parent
32eb840a42
commit
7105e9f3de
1 changed files with 2 additions and 2 deletions
|
@ -65,6 +65,8 @@ __attribute__((packed))
|
||||||
_declspec(align(4))
|
_declspec(align(4))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
/* filename cannot be NULL: "<unknown>" is used if the Python frame
|
||||||
|
filename is NULL */
|
||||||
PyObject *filename;
|
PyObject *filename;
|
||||||
int lineno;
|
int lineno;
|
||||||
} frame_t;
|
} frame_t;
|
||||||
|
@ -987,8 +989,6 @@ frame_to_pyobject(frame_t *frame)
|
||||||
if (frame_obj == NULL)
|
if (frame_obj == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (frame->filename == NULL)
|
|
||||||
frame->filename = Py_None;
|
|
||||||
Py_INCREF(frame->filename);
|
Py_INCREF(frame->filename);
|
||||||
PyTuple_SET_ITEM(frame_obj, 0, frame->filename);
|
PyTuple_SET_ITEM(frame_obj, 0, frame->filename);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue