diff options
| author | Raymond Hettinger <python@rcn.com> | 2015-08-15 22:09:30 (GMT) |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2015-08-15 22:09:30 (GMT) |
| commit | 98958fedb6b8f6f8f9bc8587f7c9884ea7c47e69 (patch) | |
| tree | 3ac25bc22800004f2a8822b53905aa7233d6f8d9 /Modules/itertoolsmodule.c | |
| parent | 1cadf769b3d453777a116a1d11831ef625ebbe99 (diff) | |
| download | cpython-98958fedb6b8f6f8f9bc8587f7c9884ea7c47e69.zip cpython-98958fedb6b8f6f8f9bc8587f7c9884ea7c47e69.tar.gz cpython-98958fedb6b8f6f8f9bc8587f7c9884ea7c47e69.tar.bz2 | |
Remove dead code (unreachable)
Diffstat (limited to 'Modules/itertoolsmodule.c')
| -rw-r--r-- | Modules/itertoolsmodule.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 2cca6b3..0d1a15b 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -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); |
