mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +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
|
@ -650,7 +650,7 @@ warn_explicit(PyObject *category, PyObject *message,
|
|||
text = PyObject_Str(message);
|
||||
if (text == NULL)
|
||||
goto cleanup;
|
||||
category = (PyObject*)message->ob_type;
|
||||
category = (PyObject*)Py_TYPE(message);
|
||||
}
|
||||
else {
|
||||
text = message;
|
||||
|
@ -906,7 +906,7 @@ get_category(PyObject *message, PyObject *category)
|
|||
return NULL;
|
||||
|
||||
if (rc == 1)
|
||||
category = (PyObject*)message->ob_type;
|
||||
category = (PyObject*)Py_TYPE(message);
|
||||
else if (category == NULL || category == Py_None)
|
||||
category = PyExc_UserWarning;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue