Skip to content

Commit 560bc59

Browse files
committed
review comments
1 parent 3ae3c48 commit 560bc59

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Modules/itertoolsmodule.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,9 @@ batched_next(batchedobject *bo)
191191
PyObject *item;
192192
PyObject *result;
193193

194-
#ifdef Py_GIL_DISABLED
195-
if (it == NULL) {
196-
return NULL;
197-
}
198-
#else
199194
if (n < 0) {
200195
return NULL;
201196
}
202-
#endif
203197
result = PyTuple_New(n);
204198
if (result == NULL) {
205199
return NULL;
@@ -219,9 +213,8 @@ batched_next(batchedobject *bo)
219213
if (PyErr_Occurred()) {
220214
if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
221215
/* Input raised an exception other than StopIteration */
222-
#ifdef Py_GIL_DISABLED
223216
FT_ATOMIC_STORE_SSIZE_RELAXED(bo->batch_size, -1);
224-
#else
217+
#ifndef Py_GIL_DISABLED
225218
Py_CLEAR(bo->it);
226219
#endif
227220
Py_DECREF(result);
@@ -230,18 +223,16 @@ batched_next(batchedobject *bo)
230223
PyErr_Clear();
231224
}
232225
if (i == 0) {
233-
#ifdef Py_GIL_DISABLED
234226
FT_ATOMIC_STORE_SSIZE_RELAXED(bo->batch_size, -1);
235-
#else
227+
#ifndef Py_GIL_DISABLED
236228
Py_CLEAR(bo->it);
237229
#endif
238230
Py_DECREF(result);
239231
return NULL;
240232
}
241233
if (bo->strict) {
242-
#ifdef Py_GIL_DISABLED
243234
FT_ATOMIC_STORE_SSIZE_RELAXED(bo->batch_size, -1);
244-
#else
235+
#ifndef Py_GIL_DISABLED
245236
Py_CLEAR(bo->it);
246237
#endif
247238
Py_DECREF(result);

0 commit comments

Comments
 (0)