bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392)

This commit is contained in:
Itamar Ostricher 2021-11-04 03:39:50 -07:00 committed by GitHub
parent e03e50377d
commit 2c045bd567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);