diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 01:24:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 01:24:48 (GMT) |
commit | a102ed7d2f0e7e05438f14d5fb72ca0358602249 (patch) | |
tree | a5a3aca7a251c82d7b35c130cc913d6009baa18a /Include/classobject.h | |
parent | 38aaaaac805fa30870e2d093e52a900dddde3b34 (diff) | |
download | cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.zip cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.tar.gz cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.tar.bz2 |
bpo-39573: Use Py_TYPE() macro in Python and Include directories (GH-18391)
Replace direct access to PyObject.ob_type with Py_TYPE().
Diffstat (limited to 'Include/classobject.h')
-rw-r--r-- | Include/classobject.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/classobject.h b/Include/classobject.h index 840431a..8742720 100644 --- a/Include/classobject.h +++ b/Include/classobject.h @@ -19,7 +19,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyMethod_Type; -#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) +#define PyMethod_Check(op) (Py_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) ((op)->ob_type == &PyInstanceMethod_Type) +#define PyInstanceMethod_Check(op) (Py_TYPE(op) == &PyInstanceMethod_Type) PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); |