From: Serhiy Storchaka Date: Sun, 27 Dec 2015 10:38:28 +0000 (+0200) Subject: Issue #20440: Applied yet one patch for using Py_SETREF. X-Git-Tag: v3.6.0a1~861 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdb908ea5466bfa09869fd2e1e7f3b17fe0fb2ea;p=python Issue #20440: Applied yet one patch for using Py_SETREF. The patch is automatically generated, it replaces the code that uses Py_CLEAR. --- bdb908ea5466bfa09869fd2e1e7f3b17fe0fb2ea diff --cc Modules/itertoolsmodule.c index 29c62e7473,ccd69be2fe..2bd0594f00 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@@ -984,14 -968,11 +980,13 @@@ cycle_setstate(cycleobject *lz, PyObjec { PyObject *saved=NULL; int firstpass; - if (!PyArg_ParseTuple(state, "Oi", &saved, &firstpass)) + + if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass)) return NULL; - Py_XINCREF(saved); + Py_INCREF(saved); - Py_CLEAR(lz->saved); - lz->saved = saved; + Py_SETREF(lz->saved, saved); lz->firstpass = firstpass != 0; + lz->index = 0; Py_RETURN_NONE; }