Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 276c371

Browse files
committed
Issue #3327: Don't overallocate in the modules_by_index list.
1 parent 23b4bfb commit 276c371

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ What's New in Python 3.0 release candiate 3?
1313
Core and Builtins
1414
-----------------
1515

16+
- Issue #3327: Don't overallocate in the modules_by_index list.
17+
1618
- Issue #1721812: Binary set operations and copy() returned the input type
1719
instead of the appropriate base type. This was incorrect because set
1820
subclasses would be created without their __init__() method being called.

Python/pystate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ _PyState_AddModule(PyObject* module, struct PyModuleDef* def)
234234
if (!def)
235235
return -1;
236236
if (!state->modules_by_index) {
237-
state->modules_by_index = PyList_New(20);
237+
state->modules_by_index = PyList_New(0);
238238
if (!state->modules_by_index)
239239
return -1;
240240
}

0 commit comments

Comments
 (0)