diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-05 19:27:54 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-05 19:27:54 (GMT) |
commit | 576f132b986b5ee60e4b84d34a519a5edcd8c03e (patch) | |
tree | f048292ddc0b5c3d6a5afc50dc2cd4b28372c655 /Objects/frameobject.c | |
parent | dcf76c9d0ab11f77eaa856ff0583c5c636ddb47d (diff) | |
download | cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.zip cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.gz cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.bz2 |
Issue #20440: Cleaning up the code by using Py_SETREF.
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 37e626d..425a9ee 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -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; } |