]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-98363: Shrink the physical size as well as the logical size (GH-100138)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Fri, 9 Dec 2022 17:02:35 +0000 (11:02 -0600)
committerGitHub <noreply@github.com>
Fri, 9 Dec 2022 17:02:35 +0000 (11:02 -0600)
Modules/itertoolsmodule.c

index 60ec11c32d01e5ecb2c9ad28138e7de3d5cc8054..c1f1e7320db7196146c0294fd405a44b8f4e0e9f 100644 (file)
@@ -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;
 }