diff options
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a7263d8..31a7c3d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -199,7 +199,8 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds) if (!PyType_IsSubtype(obj->ob_type, type)) return obj; type = obj->ob_type; - if (type->tp_init != NULL && + if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS) && + type->tp_init != NULL && type->tp_init(obj, args, kwds) < 0) { Py_DECREF(obj); obj = NULL; |