summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-06-02 12:10:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-06-02 12:10:59 (GMT)
commit5a1bb4e0809e6cc1468138fe788ce687e3d8d8f4 (patch)
treeabbf3f3e771cd1b4dd7415ff8b6f9005f69148e2 /Objects
parent7df3c156fafe7df1da67227b44029779695d84de (diff)
downloadcpython-5a1bb4e0809e6cc1468138fe788ce687e3d8d8f4.zip
cpython-5a1bb4e0809e6cc1468138fe788ce687e3d8d8f4.tar.gz
cpython-5a1bb4e0809e6cc1468138fe788ce687e3d8d8f4.tar.bz2
Initialize base types before child types
object (PyBaseObject_Type) is the base type of type (PyType_Type), int (PyLong_Type) is the base type of bool (PyBool_Type).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/object.c b/Objects/object.c
index a1a69fa..b9ae23a 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1543,6 +1543,9 @@ PyObject _Py_NotImplementedStruct = {
void
_Py_ReadyTypes(void)
{
+ if (PyType_Ready(&PyBaseObject_Type) < 0)
+ Py_FatalError("Can't initialize object type");
+
if (PyType_Ready(&PyType_Type) < 0)
Py_FatalError("Can't initialize type type");
@@ -1555,6 +1558,9 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&_PyWeakref_ProxyType) < 0)
Py_FatalError("Can't initialize weakref proxy type");
+ if (PyType_Ready(&PyLong_Type) < 0)
+ Py_FatalError("Can't initialize int type");
+
if (PyType_Ready(&PyBool_Type) < 0)
Py_FatalError("Can't initialize bool type");
@@ -1579,9 +1585,6 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PySuper_Type) < 0)
Py_FatalError("Can't initialize super type");
- if (PyType_Ready(&PyBaseObject_Type) < 0)
- Py_FatalError("Can't initialize object type");
-
if (PyType_Ready(&PyRange_Type) < 0)
Py_FatalError("Can't initialize range type");
@@ -1606,9 +1609,6 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyFloat_Type) < 0)
Py_FatalError("Can't initialize float type");
- if (PyType_Ready(&PyLong_Type) < 0)
- Py_FatalError("Can't initialize int type");
-
if (PyType_Ready(&PyFrozenSet_Type) < 0)
Py_FatalError("Can't initialize frozenset type");