8000 GH-98363: Fix exception handling in batched() by rhettinger · Pull Request #98523 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-98363: Fix exception handling in batched() #98523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 21, 2022
Merged
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
Loop invariant code motion: hoist the slot lookup out of the loop.
  • Loading branch information
rhettinger committed Oct 21, 2022
commit 699bdf679228c2595a40245db69d3498f503b8df
3 changes: 2 additions & 1 deletion Modules/itertoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ batched_next(batchedobject *bo)
if (result == NULL) {
return NULL;
}
iternextfunc iternext = *Py_TYPE(it)->tp_iternext;
for (i=0 ; i < n ; i++) {
item = (*Py_TYPE(it)->tp_iternext)(it);
item = iternext(it);
if (item == NULL) {
goto null_item;
}
Expand Down
0