]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function
authorBenjamin Peterson <benjamin@python.org>
Wed, 31 Oct 2012 03:41:54 +0000 (23:41 -0400)
committerBenjamin Peterson <benjamin@python.org>
Wed, 31 Oct 2012 03:41:54 +0000 (23:41 -0400)
Objects/object.c
Python/bltinmodule.c

index b4bc96dc15f1c4f3f427c965dd39846842aee723..fd1fd256ba75b49920b35259c83253c34ddbae6a 100644 (file)
@@ -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");
 
index 0e6e6ff9ff37fe0c42155b3065c235c9de53d4c4..fac64bcc69ffab084a392bb2719c8d1b51173105 100644 (file)
@@ -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;