From: Benjamin Peterson Date: Wed, 31 Oct 2012 03:21:10 +0000 (-0400) Subject: initialize more global type objects (closes #16369) X-Git-Tag: v3.2.4rc1~393 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c43112823b1f748822c43ad42566537580c02af2;p=thirdparty%2FPython%2Fcpython.git initialize more global type objects (closes #16369) --- diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index f6201e5bb001..02a81f11dc3d 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -63,6 +63,9 @@ PyInit__symtable(void) { PyObject *m; + if (PyType_Ready(&PySTEntry_Type) < 0) + return NULL; + m = PyModule_Create(&symtablemodule); if (m == NULL) return NULL; diff --git a/Objects/object.c b/Objects/object.c index 4730a66659c7..28bb9c1e46a5 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1644,6 +1644,30 @@ _Py_ReadyTypes(void) if (PyType_Ready(&PyZip_Type) < 0) Py_FatalError("Can't initialize zip type"); + + if (PyType_Ready(&PyCapsule_Type) < 0) + Py_FatalError("Can't initialize capsule type"); + + if (PyType_Ready(&PyLongRangeIter_Type) < 0) + Py_FatalError("Can't initialize long range iterator type"); + + if (PyType_Ready(&PyCell_Type) < 0) + Py_FatalError("Can't initialize cell type"); + + if (PyType_Ready(&PyInstanceMethod_Type) < 0) + Py_FatalError("Can't initialize instance method type"); + + if (PyType_Ready(&PyClassMethodDescr_Type) < 0) + Py_FatalError("Can't initialize class method descr type"); + + if (PyType_Ready(&PyMethodDescr_Type) < 0) + Py_FatalError("Can't initialize method descr type"); + + if (PyType_Ready(&PyCallIter_Type) < 0) + Py_FatalError("Can't initialize call iter type"); + + if (PyType_Ready(&PySeqIter_Type) < 0) + Py_FatalError("Can't initialize sequence iterator type"); } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3ef9c9bbaf39..35b424e33ab3 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -10079,6 +10079,12 @@ void _PyUnicode_Init(void) ); PyType_Ready(&EncodingMapType); + + if (PyType_Ready(&PyFieldNameIter_Type) < 0) + Py_FatalError("Can't initialize field name iterator type"); + + if (PyType_Ready(&PyFormatterIter_Type) < 0) + Py_FatalError("Can't initialize formatter iter type"); } /* Finalize the Unicode implementation */