Skip to content

Commit a91f13c

Browse files
committed
add comment for incref rationale
1 parent 11e727d commit a91f13c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/itertoolsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ pairwise_next_lock_held(PyObject *op)
366366
return NULL;
367367
}
368368
}
369-
Py_INCREF(old);
369+
Py_INCREF(old); // needed because of reentant calls via call to the iterator
370370
new = (*Py_TYPE(it)->tp_iternext)(it);
371371
if (new == NULL) {
372372
Py_CLEAR(po->it);

0 commit comments

Comments
 (0)