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

This commit is contained in:
Victor Stinner 2020-09-22 12:42:28 +02:00 committed by GitHub
parent 62e40d8450
commit c5cb077ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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) { 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) #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type)