mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #20041: Fixed TypeError when frame.f_trace is set to None.
Patch by Xavier de Gaye.
This commit is contained in:
commit
64c26e5f60
3 changed files with 14 additions and 0 deletions
|
@ -344,6 +344,8 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
|
|||
/* We rely on f_lineno being accurate when f_trace is set. */
|
||||
f->f_lineno = PyFrame_GetLineNumber(f);
|
||||
|
||||
if (v == Py_None)
|
||||
v = NULL;
|
||||
Py_XINCREF(v);
|
||||
Py_XSETREF(f->f_trace, v);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue