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
|
@ -419,7 +419,7 @@ match_class_attr(PyThreadState *tstate, PyObject *subject, PyObject *type,
|
|||
return NULL;
|
||||
}
|
||||
PyObject *attr;
|
||||
(void)_PyObject_LookupAttr(subject, name, &attr);
|
||||
(void)PyObject_GetOptionalAttr(subject, name, &attr);
|
||||
return attr;
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
|
|||
// First, the positional subpatterns:
|
||||
if (nargs) {
|
||||
int match_self = 0;
|
||||
if (_PyObject_LookupAttr(type, &_Py_ID(__match_args__), &match_args) < 0) {
|
||||
if (PyObject_GetOptionalAttr(type, &_Py_ID(__match_args__), &match_args) < 0) {
|
||||
goto fail;
|
||||
}
|
||||
if (match_args) {
|
||||
|
@ -2414,7 +2414,7 @@ import_from(PyThreadState *tstate, PyObject *v, PyObject *name)
|
|||
PyObject *x;
|
||||
PyObject *fullmodname, *pkgname, *pkgpath, *pkgname_or_unknown, *errmsg;
|
||||
|
||||
if (_PyObject_LookupAttr(v, name, &x) != 0) {
|
||||
if (PyObject_GetOptionalAttr(v, name, &x) != 0) {
|
||||
return x;
|
||||
}
|
||||
/* Issue #17636: in case this failed because of a circular relative
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue