From: Victor Stinner Date: Tue, 22 Sep 2020 10:42:28 +0000 (+0200) Subject: Py_IS_TYPE() macro uses Py_TYPE() (GH-22341) X-Git-Tag: v3.10.0a1~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5cb077ab3c88394b7ac8ed4e746bd31b53e39f1;p=thirdparty%2FPython%2Fcpython.git Py_IS_TYPE() macro uses Py_TYPE() (GH-22341) --- diff --git a/Include/object.h b/Include/object.h index 10f1d6a3dff2..6ee4ee784855 100644 --- a/Include/object.h +++ b/Include/object.h @@ -141,7 +141,7 @@ static inline PyTypeObject* _Py_TYPE(const PyObject *ob) { static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) { - return ob->ob_type == type; + return Py_TYPE(ob) == type; } #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type)