summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorItamar Ostricher <itamarost@gmail.com>2021-11-04 10:39:50 (GMT)
committerGitHub <noreply@github.com>2021-11-04 10:39:50 (GMT)
commit2c045bd5673d56c3fdde7536da9df1c7d6f270f0 (patch)
tree870db168ece98d58b4dd5cb2a432505917b5156d
parente03e50377d6f8f212af60fed4ae405ebeb73237d (diff)
downloadcpython-2c045bd5673d56c3fdde7536da9df1c7d6f270f0.zip
cpython-2c045bd5673d56c3fdde7536da9df1c7d6f270f0.tar.gz
cpython-2c045bd5673d56c3fdde7536da9df1c7d6f270f0.tar.bz2
bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392)
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 18bea47..51ec93d 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);