Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test case I()
  • Loading branch information
rhettinger committed Oct 17, 2022
commit 8238c28a71d1bff685a3e0d5d2eb54766ce2f65f
2 changes: 1 addition & 1 deletion Lib/test/test_itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ def test_batched(self):
s = 'abcde'
r = [['a', 'b'], ['c', 'd'], ['e']]
n = 2
for g in (G, Ig, L, R): # XXX I(s) is failing
for g in (G, I, Ig, L, R):
with self.subTest(g=g):
self.assertEqual(list(batched(g(s), n)), r)
self.assertEqual(list(batched(S(s), 2)), [])
Expand Down
2 changes: 1 addition & 1 deletion Modules/itertoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ batched_next(batchedobject *bo)
return NULL;
}
for (i=0 ; i < bo->batch_size ; i++) {
item = (*Py_TYPE(it)->tp_iternext)(it);
item = PyIter_Next(it);
if (item == NULL) {
break;
}
Expand Down