summaryrefslogtreecommitdiff
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 65d0142505..4b0a4d88c4 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -834,8 +834,7 @@ teedataobject_safe_decref(PyObject *obj)
Py_REFCNT(obj) == 1) {
PyObject *nextlink = ((teedataobject *)obj)->nextlink;
((teedataobject *)obj)->nextlink = NULL;
- Py_DECREF(obj);
- obj = nextlink;
+ Py_SETREF(obj, nextlink);
}
Py_XDECREF(obj);
}