]> granicus.if.org Git - python/commitdiff
Remove dead code (unreachable)
authorRaymond Hettinger <python@rcn.com>
Sat, 15 Aug 2015 22:09:30 +0000 (15:09 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 15 Aug 2015 22:09:30 +0000 (15:09 -0700)
Modules/itertoolsmodule.c

index 2cca6b3550b95c09d1d68b2c1d19084a5947b7a4..0d1a15b10ce1c487015c53fedb9cddf5d1d73981 100644 (file)
@@ -940,12 +940,9 @@ cycle_next(cycleobject *lz)
             }
             return item;
         }
-        if (PyErr_Occurred()) {
-            if (PyErr_ExceptionMatches(PyExc_StopIteration))
-                PyErr_Clear();
-            else
+        /* Note:  StopIteration is already cleared by PyIter_Next() */
+        if (PyErr_Occurred())
                 return NULL;
-        }
         if (PyList_Size(lz->saved) == 0)
             return NULL;
         it = PyObject_GetIter(lz->saved);