diff options
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 35dc76f..f15b096 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -273,6 +273,9 @@ PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; + if (!(a->tp_flags & Py_TPFLAGS_HAVE_CLASS)) + return b == a || b == &PyBaseObject_Type; + mro = a->tp_mro; if (mro != NULL) { /* Deal with multiple inheritance without recursion |