]> granicus.if.org Git - python/commitdiff
Issue #3327: Don't overallocate in the modules_by_index list.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 17 Nov 2008 16:22:11 +0000 (16:22 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 17 Nov 2008 16:22:11 +0000 (16:22 +0000)
Misc/NEWS
Python/pystate.c

index 874f27bc041ca1d80e4d519382f5c0ec45566b01..acedeb1d4b6aeb9bca566233ce97fa907f9421ea 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,8 @@ What's New in Python 3.0 release candiate 3?
 Core and Builtins
 -----------------
 
+- Issue #3327: Don't overallocate in the modules_by_index list.
+
 - Issue #1721812:  Binary set operations and copy() returned the input type
   instead of the appropriate base type.  This was incorrect because set 
   subclasses would be created without their __init__() method being called.
index 2a9b7443f974304bd014df67d2fca6c409898f2d..fe5de5f4d2219c31dbabe8c6bb12bd3bec956443 100644 (file)
@@ -234,7 +234,7 @@ _PyState_AddModule(PyObject* module, struct PyModuleDef* def)
        if (!def)
                return -1;
        if (!state->modules_by_index) {
-               state->modules_by_index = PyList_New(20);
+               state->modules_by_index = PyList_New(0);
                if (!state->modules_by_index)
                        return -1;
        }