We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c890ed commit 50ec742Copy full SHA for 50ec742
Modules/itertoolsmodule.c
@@ -167,14 +167,13 @@ batched_next(batchedobject *bo)
167
168
null_item:
169
if (PyErr_Occurred()) {
170
- if (PyErr_ExceptionMatches(PyExc_StopIteration)) {
171
- PyErr_Clear();
172
- } else {
173
- /* input raised an exception other than StopIteration */
+ if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
+ /* Input raised an exception other than StopIteration */
174
Py_CLEAR(bo->it);
175
Py_DECREF(result);
176
return NULL;
177
}
+ PyErr_Clear();
178
179
if (i == 0) {
180
0 commit comments