Skip to content

Commit 50ec742

Browse files
committed
Minor beautification
1 parent 7c890ed commit 50ec742

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/itertoolsmodule.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,13 @@ batched_next(batchedobject *bo)
167167

168168
null_item:
169169
if (PyErr_Occurred()) {
170-
if (PyErr_ExceptionMatches(PyExc_StopIteration)) {
171-
PyErr_Clear();
172-
} else {
173-
/* input raised an exception other than StopIteration */
170+
if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
171+
/* Input raised an exception other than StopIteration */
174172
Py_CLEAR(bo->it);
175173
Py_DECREF(result);
176174
return NULL;
177175
}
176+
PyErr_Clear();
178177
}
179178
if (i == 0) {
180179
Py_CLEAR(bo->it);

0 commit comments

Comments
 (0)