Commit 8049dde8 authored by Raymond Hettinger's avatar Raymond Hettinger

Removed duplicate test from inner loop.

The PyIter_Check is already performed by PyObject_GetIter.
parent 6f177d43
...@@ -2182,12 +2182,7 @@ PyObject * ...@@ -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() &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment