Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 44016:22e09905e400
Use proper API for iter.__next__().
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sat, 24 Nov 2007 20:42:02 +0000 |
| parents | 8744e41daf54 |
| children | 7b4e94a7b92e |
line wrap: on
line diff
--- a/Objects/stringobject.c Sat Nov 24 12:40:29 2007 +0000 +++ b/Objects/stringobject.c Sat Nov 24 20:42:02 2007 +0000 @@ -2945,8 +2945,6 @@ it = PyObject_GetIter(x); if (it == NULL) goto error; - // XXX(brett.cannon): No API for this? - iternext = *Py_Type(it)->tp_iternext; /* Run the iterator to exhaustion */ for (i = 0; ; i++) { @@ -2954,13 +2952,10 @@ Py_ssize_t value; /* Get the next item */ - item = iternext(it); + item = PyIter_Next(it); if (item == NULL) { - if (PyErr_Occurred()) { - if (!PyErr_ExceptionMatches(PyExc_StopIteration)) - goto error; - PyErr_Clear(); - } + if (PyErr_Occurred()) + goto error; break; }
