From 8c215466dbcdfbdedf0faba7c8ae64461069042b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 9 Dec 2022 11:02:35 -0600 Subject: GH-98363: Shrink the physical size as well as the logical size (GH-100138) --- Modules/itertoolsmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 60ec11c..c1f1e73 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; } -- cgit v0.12