mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Removed duplicate test from inner loop.
The PyIter_Check is already performed by PyObject_GetIter.
This commit is contained in:
parent
6f177d434f
commit
8049dde8d7
1 changed files with 1 additions and 6 deletions
|
@ -2182,12 +2182,7 @@ PyObject *
|
||||||
PyIter_Next(PyObject *iter)
|
PyIter_Next(PyObject *iter)
|
||||||
{
|
{
|
||||||
PyObject *result;
|
PyObject *result;
|
||||||
if (!PyIter_Check(iter)) {
|
assert(PyIter_Check(iter));
|
||||||
PyErr_Format(PyExc_TypeError,
|
|
||||||
"'%.100s' object is not an iterator",
|
|
||||||
iter->ob_type->tp_name);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
result = (*iter->ob_type->tp_iternext)(iter);
|
result = (*iter->ob_type->tp_iternext)(iter);
|
||||||
if (result == NULL &&
|
if (result == NULL &&
|
||||||
PyErr_Occurred() &&
|
PyErr_Occurred() &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue