mirror of https://github.com/python/cpython
bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392)
This commit is contained in:
parent
e03e50377d
commit
2c045bd567
|
@ -1121,7 +1121,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
|
|
||||||
/* If the returned object is not an instance of type,
|
/* If the returned object is not an instance of type,
|
||||||
it won't be initialized. */
|
it won't be initialized. */
|
||||||
if (!PyType_IsSubtype(Py_TYPE(obj), type))
|
if (!PyObject_TypeCheck(obj, type))
|
||||||
return obj;
|
return obj;
|
||||||
|
|
||||||
type = Py_TYPE(obj);
|
type = Py_TYPE(obj);
|
||||||
|
|
Loading…
Reference in New Issue