diff --git a/Objects/typeobject.c b/Objects/typeobject.c index d6e4199204e..7ff3804b2b7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1137,7 +1137,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds) /* If the returned object is not an instance of type, it won't be initialized. */ - if (!PyType_IsSubtype(Py_TYPE(obj), type)) + if (!PyObject_TypeCheck(obj, type)) return obj; type = Py_TYPE(obj); @@ -1531,10 +1531,6 @@ PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; - if (a == b) { - return 1; - } - mro = a->tp_mro; if (mro != NULL) { /* Deal with multiple inheritance without recursion