Skip to content

Commit

Permalink
bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392)
Browse files Browse the repository at this point in the history
  • Loading branch information
itamaro authored Nov 4, 2021
1 parent e03e503 commit 2c045bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2c045bd

Please sign in to comment.