summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-01-05 21:27:54 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-01-05 21:27:54 +0200
commit93c98b688bef3bf08c027315a744869b590ceef3 (patch)
tree40957d06fc05cda36c06cca475e8bef11999ed78 /Python/sysmodule.c
parentc8a68313d9003cacd48415cca4beb12b7bf386ba (diff)
downloadcpython-93c98b688bef3bf08c027315a744869b590ceef3.tar.gz
Issue #20440: Cleaning up the code by using Py_SETREF.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index f784f756d5..53dd4a1df3 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -436,10 +436,7 @@ trace_trampoline(PyObject *self, PyFrameObject *frame,
return -1;
}
if (result != Py_None) {
- PyObject *temp = frame->f_trace;
- frame->f_trace = NULL;
- Py_XDECREF(temp);
- frame->f_trace = result;
+ Py_SETREF(frame->f_trace, result);
}
else {
Py_DECREF(result);