mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #20440: Cleaning up the code by using Py_SETREF.
This commit is contained in:
parent
dcf76c9d0a
commit
576f132b98
14 changed files with 39 additions and 120 deletions
|
@ -349,15 +349,11 @@ frame_gettrace(PyFrameObject *f, void *closure)
|
|||
static int
|
||||
frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
|
||||
{
|
||||
PyObject* old_value;
|
||||
|
||||
/* We rely on f_lineno being accurate when f_trace is set. */
|
||||
f->f_lineno = PyFrame_GetLineNumber(f);
|
||||
|
||||
old_value = f->f_trace;
|
||||
Py_XINCREF(v);
|
||||
f->f_trace = v;
|
||||
Py_XDECREF(old_value);
|
||||
Py_SETREF(f->f_trace, v);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue