Skip to content

Commit

Permalink
pythongh-101892 : Updated Cython/objects/iterobject.c Line 217
Browse files Browse the repository at this point in the history
  • Loading branch information
workingpayload committed Feb 15, 2023
1 parent 188e388 commit 0f9cea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Objects/iterobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,14 @@ calliter_iternext(calliterobject *it)
}

result = _PyObject_CallNoArgs(it->it_callable);
if (result != NULL && it->it_callable != NULL) {
if (result != NULL && it->it_sentinel != NULL){
int ok;

ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
if (ok == 0) {
return result; /* Common case, fast path */
}

Py_DECREF(result);
if (ok > 0) {
Py_CLEAR(it->it_callable);
Py_CLEAR(it->it_sentinel);
Expand All @@ -233,6 +232,7 @@ calliter_iternext(calliterobject *it)
Py_CLEAR(it->it_callable);
Py_CLEAR(it->it_sentinel);
}
Py_XDECREF(result);
return NULL;
}

Expand Down

0 comments on commit 0f9cea1

Please sign in to comment.