@@ -196,19 +196,19 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL;
196
196
197
197
/* Macros for type checking when not building the Python core. */
198
198
#define PyDate_Check (op ) PyObject_TypeCheck(op, PyDateTimeAPI->DateType)
199
- #define PyDate_CheckExact (op ) (Py_TYPE(op) == PyDateTimeAPI->DateType)
199
+ #define PyDate_CheckExact (op ) Py_IS_TYPE(op, PyDateTimeAPI->DateType)
200
200
201
201
#define PyDateTime_Check (op ) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType)
202
- #define PyDateTime_CheckExact (op ) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType)
202
+ #define PyDateTime_CheckExact (op ) Py_IS_TYPE(op, PyDateTimeAPI->DateTimeType)
203
203
204
204
#define PyTime_Check (op ) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType)
205
- #define PyTime_CheckExact (op ) (Py_TYPE(op) == PyDateTimeAPI->TimeType)
205
+ #define PyTime_CheckExact (op ) Py_IS_TYPE(op, PyDateTimeAPI->TimeType)
206
206
207
207
#define PyDelta_Check (op ) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType)
208
- #define PyDelta_CheckExact (op ) (Py_TYPE(op) == PyDateTimeAPI->DeltaType)
208
+ #define PyDelta_CheckExact (op ) Py_IS_TYPE(op, PyDateTimeAPI->DeltaType)
209
209
210
210
#define PyTZInfo_Check (op ) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType)
211
- #define PyTZInfo_CheckExact (op ) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType)
211
+ #define PyTZInfo_CheckExact (op ) Py_IS_TYPE(op, PyDateTimeAPI->TZInfoType)
212
212
213
213
214
214
/* Macros for accessing constructors in a simplified fashion. */
0 commit comments