summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-01-05 19:27:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-01-05 19:27:54 (GMT)
commit576f132b986b5ee60e4b84d34a519a5edcd8c03e (patch)
treef048292ddc0b5c3d6a5afc50dc2cd4b28372c655 /Modules/_elementtree.c
parentdcf76c9d0ab11f77eaa856ff0583c5c636ddb47d (diff)
downloadcpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.zip
cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.gz
cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.bz2
Issue #20440: Cleaning up the code by using Py_SETREF.
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 580c53a..0effc3f 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -396,10 +396,8 @@ element_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_XDECREF(attrib);
/* Replace the objects already pointed to by tag, text and tail. */
- tmp = self_elem->tag;
Py_INCREF(tag);
- self_elem->tag = tag;
- Py_DECREF(tmp);
+ Py_SETREF(self_elem->tag, tag);
tmp = self_elem->text;
Py_INCREF(Py_None);