gh-83754: Use the Py_TYPE() macro (#120599)

Don't access directly PyObject.ob_type, but use the Py_TYPE() macro
instead.
This commit is contained in:
Victor Stinner 2024-06-17 10:34:29 +02:00 committed by GitHub
parent 3df2022931
commit c2d5df5787
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 12 deletions

View file

@ -637,7 +637,7 @@ specialize_module_load_attr(
) {
_PyAttrCache *cache = (_PyAttrCache *)(instr + 1);
PyModuleObject *m = (PyModuleObject *)owner;
assert((owner->ob_type->tp_flags & Py_TPFLAGS_MANAGED_DICT) == 0);
assert((Py_TYPE(owner)->tp_flags & Py_TPFLAGS_MANAGED_DICT) == 0);
PyDictObject *dict = (PyDictObject *)m->md_dict;
if (dict == NULL) {
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_NO_DICT);