mirror of
https://github.com/python/cpython.git
synced 2025-09-11 03:07:01 +00:00
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:
parent
648b4de3d3
commit
f4848dac41
4 changed files with 35 additions and 66 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue