From: Itamar Ostricher Date: Thu, 4 Nov 2021 10:39:50 +0000 (-0700) Subject: bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392) X-Git-Tag: v3.11.0a2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c045bd5673d56c3fdde7536da9df1c7d6f270f0;p=thirdparty%2FPython%2Fcpython.git bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392) --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 18bea476ea9f..51ec93d87527 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1121,7 +1121,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);