]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Py_IS_TYPE() macro uses Py_TYPE() (GH-22341)
authorVictor Stinner <vstinner@python.org>
Tue, 22 Sep 2020 10:42:28 +0000 (12:42 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 10:42:28 +0000 (12:42 +0200)
Include/object.h

index 10f1d6a3dff2dd1ded5147b44cf2fb37f993de1c..6ee4ee7848551e36112cb120f2bf75f6c920d189 100644 (file)
@@ -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)