diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 61cbeae..af133ea 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1221,6 +1221,12 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) /* Look in tp_dict of types in MRO */ mro = type->tp_mro; + if (mro == NULL) { + if (PyType_Ready(type) < 0) + return NULL; + mro = type->tp_mro; + assert(mro != NULL); + } assert(PyTuple_Check(mro)); n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { |