From: Benjamin Peterson Date: Wed, 31 Oct 2012 03:21:10 +0000 (-0400) Subject: initialize more global type objects (closes #16369) X-Git-Tag: v2.7.4rc1~433 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6da3ed63d83375f183fa94cbf7c55acea128e088;p=thirdparty%2FPython%2Fcpython.git initialize more global type objects (closes #16369) --- diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index 60f9ba99d1a6..15c0f92bf416 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -52,6 +52,9 @@ init_symtable(void) { PyObject *m; + if (PyType_Ready(&PySTEntry_Type) < 0) + return; + m = Py_InitModule("_symtable", symtable_methods); if (m == NULL) return; diff --git a/Objects/object.c b/Objects/object.c index 9fea13a33936..e732dceff646 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2198,6 +2198,18 @@ _Py_ReadyTypes(void) if (PyType_Ready(&PyFile_Type) < 0) Py_FatalError("Can't initialize file type"); + + if (PyType_Ready(&PyCapsule_Type) < 0) + Py_FatalError("Can't initialize capsule type"); + + if (PyType_Ready(&PyCell_Type) < 0) + Py_FatalError("Can't initialize cell 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 79b87df7e739..a4c04f41861b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8847,6 +8847,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 */