bpo-39573: PyXXX_Check() macros use Py_IS_TYPE() (GH-18508)

Update PyXXX_Check() macros in Include/ to use
the new Py_IS_TYPE function.
This commit is contained in:
Dong-hee Na 2020-02-14 16:48:12 +09:00 committed by GitHub
parent 7386a70746
commit d212c3c55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyMethod_Type; 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 *); PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
@ -40,7 +40,7 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; 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_New(PyObject *);
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);

View File

@ -12,7 +12,7 @@ extern "C" {
PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type; 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 */ /* Create a PickleBuffer redirecting to the given buffer-enabled object */
PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *); PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *);