@@ -196,19 +196,19 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL;
196196
197197/* Macros for type checking when not building the Python core. */
198198#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)
200200
201201#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)
203203
204204#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)
206206
207207#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)
209209
210210#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)
212212
213213
214214/* Macros for accessing constructors in a simplified fashion. */
0 commit comments