Author: georg.brandl
Date: Sat Nov 24 21:42:02 2007
New Revision: 59178

Modified:
   python/branches/py3k/Objects/stringobject.c
Log:
Use proper API for iter.__next__().


Modified: python/branches/py3k/Objects/stringobject.c
==============================================================================
--- python/branches/py3k/Objects/stringobject.c (original)
+++ python/branches/py3k/Objects/stringobject.c Sat Nov 24 21:42:02 2007
@@ -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;
                }
 
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to