mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
This commit is contained in:
parent
e8ab0096a5
commit
be1b968dc1
45 changed files with 351 additions and 352 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue