mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-39573: Use Py_TYPE() macro in Python and Include directories (GH-18391)
Replace direct access to PyObject.ob_type with Py_TYPE().
This commit is contained in:
parent
38aaaaac80
commit
a102ed7d2f
12 changed files with 39 additions and 39 deletions
|
@ -54,11 +54,11 @@ PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *);
|
|||
PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
|
||||
|
||||
#define PyExceptionInstance_Check(x) \
|
||||
PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
|
||||
PyType_FastSubclass(Py_TYPE(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)
|
||||
|
||||
PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *);
|
||||
|
||||
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
|
||||
#define PyExceptionInstance_Class(x) ((PyObject*)Py_TYPE(x))
|
||||
|
||||
|
||||
/* Predefined exceptions */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue