Skip to content

Commit c5cb077

Browse files
authored
Py_IS_TYPE() macro uses Py_TYPE() (GH-22341)
1 parent 62e40d8 commit c5cb077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static inline PyTypeObject* _Py_TYPE(const PyObject *ob) {
141141

142142

143143
static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) {
144-
return ob->ob_type == type;
144+
return Py_TYPE(ob) == type;
145145
}
146146
#define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type)
147147

0 commit comments

Comments
 (0)