From: Raymond Hettinger Date: Fri, 9 Dec 2022 17:02:35 +0000 (-0600) Subject: GH-98363: Shrink the physical size as well as the logical size (GH-100138) X-Git-Tag: v3.12.0a4~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c215466dbcdfbdedf0faba7c8ae64461069042b;p=thirdparty%2FPython%2Fcpython.git GH-98363: Shrink the physical size as well as the logical size (GH-100138) --- diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 60ec11c32d01..c1f1e7320db7 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; }