summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2022-12-09 11:02:35 -0600
committerGitHub <noreply@github.com>2022-12-09 11:02:35 -0600
commit8c215466dbcdfbdedf0faba7c8ae64461069042b (patch)
tree92a365d762c993543f173698d7b85b177328365f
parentd0679c12398579fe9f10e78b6332dded119e4697 (diff)
downloadcpython-git-8c215466dbcdfbdedf0faba7c8ae64461069042b.tar.gz
GH-98363: Shrink the physical size as well as the logical size (GH-100138)
-rw-r--r--Modules/itertoolsmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 60ec11c32d..c1f1e7320d 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -182,8 +182,7 @@ batched_next(batchedobject *bo)
Py_DECREF(result);
return NULL;
}
- /* Elements in result[i:] are still NULL */
- Py_SET_SIZE(result, i);
+ _PyTuple_Resize(&result, i);
return result;
}