Py_IS_TYPE() macro uses Py_TYPE() (GH-22341)

diff --git a/Include/object.h b/Include/object.h
index 10f1d6a..6ee4ee7 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -141,7 +141,7 @@
 
 
 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)