mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Replace structure member before decreffing.
This commit is contained in:
parent
4c3d054d3d
commit
880430e2a5
1 changed files with 3 additions and 1 deletions
|
@ -662,6 +662,7 @@ cycle_next(cycleobject *lz)
|
|||
{
|
||||
PyObject *item;
|
||||
PyObject *it;
|
||||
PyObject *tmp;
|
||||
|
||||
while (1) {
|
||||
item = PyIter_Next(lz->it);
|
||||
|
@ -681,9 +682,10 @@ cycle_next(cycleobject *lz)
|
|||
it = PyObject_GetIter(lz->saved);
|
||||
if (it == NULL)
|
||||
return NULL;
|
||||
Py_DECREF(lz->it);
|
||||
tmp = lz->it;
|
||||
lz->it = it;
|
||||
lz->firstpass = 1;
|
||||
Py_DECREF(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue