]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
avoid resize of 0-length tuple
authorGuido van Rossum <guido@python.org>
Fri, 4 Aug 1995 04:07:45 +0000 (04:07 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 4 Aug 1995 04:07:45 +0000 (04:07 +0000)
Python/bltinmodule.c

index 21562ae71b90b1499b923fcd820b2937f676743e..944525591ba9b4ec4bd6ba10c0ad8eef925f3f5c 100644 (file)
@@ -1527,6 +1527,11 @@ filtertuple(func, tuple)
        register int i, j;
        int len = gettuplesize(tuple);
 
+       if (len == 0) {
+               INCREF(tuple);
+               return tuple;
+       }
+
        if ((result = newtupleobject(len)) == NULL)
                return NULL;