Make PyIter_Next() a little smarter (wrt its knowledge of iterator

internals) so clients can be a lot dumber (wrt their knowledge).
This commit is contained in:
Tim Peters 2001-05-05 00:14:56 +00:00
parent 648b4de3d3
commit f4848dac41
4 changed files with 35 additions and 66 deletions

View file

@ -1894,11 +1894,9 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
PUSH(x);
continue;
}
if (!PyErr_Occurred() ||
PyErr_ExceptionMatches(
PyExc_StopIteration))
{
x = v = POP();
if (!PyErr_Occurred()) {
/* iterator ended normally */
x = v = POP();
Py_DECREF(v);
JUMPBY(oparg);
continue;