From ed902313b9a1d605b4b3c2f6527090d09d63c481 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Fri, 14 Feb 2020 10:20:07 +0900 Subject: [PATCH] bpo-39573: Update Include/* to use Py_IS_TYPE --- Include/classobject.h | 4 ++-- Include/picklebufobject.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/classobject.h b/Include/classobject.h index 8742720720550c..1952f673b7d865 100644 --- a/Include/classobject.h +++ b/Include/classobject.h @@ -19,7 +19,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyMethod_Type; -#define PyMethod_Check(op) (Py_TYPE(op)== &PyMethod_Type) +#define PyMethod_Check(op) Py_IS_TYPE(op, &PyMethod_Type) PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *); @@ -40,7 +40,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; -#define PyInstanceMethod_Check(op) (Py_TYPE(op) == &PyInstanceMethod_Type) +#define PyInstanceMethod_Check(op) Py_IS_TYPE(op, &PyInstanceMethod_Type) PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); diff --git a/Include/picklebufobject.h b/Include/picklebufobject.h index f07e900bf26dac..0df2561dceaea0 100644 --- a/Include/picklebufobject.h +++ b/Include/picklebufobject.h @@ -12,7 +12,7 @@ extern "C" { PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type; -#define PyPickleBuffer_Check(op) (Py_TYPE(op) == &PyPickleBuffer_Type) +#define PyPickleBuffer_Check(op) Py_IS_TYPE(op, &PyPickleBuffer_Type) /* Create a PickleBuffer redirecting to the given buffer-enabled object */ PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *);