gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)

This commit is contained in:
Serhiy Storchaka 2023-07-12 08:57:10 +03:00 committed by GitHub
parent e8ab0096a5
commit be1b968dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 351 additions and 352 deletions

View file

@ -223,7 +223,7 @@ get_warnings_attr(PyInterpreterState *interp, PyObject *attr, int try_import)
return NULL;
}
(void)_PyObject_LookupAttr(warnings_module, attr, &obj);
(void)PyObject_GetOptionalAttr(warnings_module, attr, &obj);
Py_DECREF(warnings_module);
return obj;
}
@ -1069,7 +1069,7 @@ get_source_line(PyInterpreterState *interp, PyObject *module_globals, int lineno
Py_INCREF(module_name);
/* Make sure the loader implements the optional get_source() method. */
(void)_PyObject_LookupAttr(loader, &_Py_ID(get_source), &get_source);
(void)PyObject_GetOptionalAttr(loader, &_Py_ID(get_source), &get_source);
Py_DECREF(loader);
if (!get_source) {
Py_DECREF(module_name);