summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-30 23:41:54 -0400
committerBenjamin Peterson <benjamin@python.org>2012-10-30 23:41:54 -0400
commit3e2d4b8800fb0cd0afe4da7ca6537f8f23847879 (patch)
tree06b7f894f98a8dabdb43eaf1815a4b34a4b0895b
parente25a90fb60337ee37cc7597153355fbd1092d291 (diff)
downloadcpython-3e2d4b8800fb0cd0afe4da7ca6537f8f23847879.tar.gz
initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function
-rw-r--r--Objects/object.c9
-rw-r--r--Python/bltinmodule.c6
2 files changed, 6 insertions, 9 deletions
diff --git a/Objects/object.c b/Objects/object.c
index b4bc96dc15..fd1fd256ba 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1708,15 +1708,6 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyMemberDescr_Type) < 0)
Py_FatalError("Can't initialize member descriptor type");
- if (PyType_Ready(&PyFilter_Type) < 0)
- Py_FatalError("Can't initialize filter type");
-
- if (PyType_Ready(&PyMap_Type) < 0)
- Py_FatalError("Can't initialize map type");
-
- if (PyType_Ready(&PyZip_Type) < 0)
- Py_FatalError("Can't initialize zip type");
-
if (PyType_Ready(&_PyNamespace_Type) < 0)
Py_FatalError("Can't initialize namespace type");
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 0e6e6ff9ff..fac64bcc69 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2405,6 +2405,12 @@ PyObject *
_PyBuiltin_Init(void)
{
PyObject *mod, *dict, *debug;
+
+ if (PyType_Ready(&PyFilter_Type) < 0 ||
+ PyType_Ready(&PyMap_Type) < 0 ||
+ PyType_Ready(&PyZip_Type) < 0)
+ return NULL;
+
mod = PyModule_Create(&builtinsmodule);
if (mod == NULL)
return NULL;