diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-12 05:57:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 05:57:10 (GMT) |
commit | be1b968dc1e63c3c68e161ddc5a05eb064833440 (patch) | |
tree | 8689ba9f656854b83bf24b82de4fc471437a51ab /Objects/classobject.c | |
parent | e8ab0096a583184fe24dfbc39eff70d270c8e6f4 (diff) | |
download | cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.zip cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.gz cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.bz2 |
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 71c4a4e..548b867 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -275,9 +275,9 @@ method_repr(PyMethodObject *a) PyObject *funcname, *result; const char *defname = "?"; - if (_PyObject_LookupAttr(func, &_Py_ID(__qualname__), &funcname) < 0 || + if (PyObject_GetOptionalAttr(func, &_Py_ID(__qualname__), &funcname) < 0 || (funcname == NULL && - _PyObject_LookupAttr(func, &_Py_ID(__name__), &funcname) < 0)) + PyObject_GetOptionalAttr(func, &_Py_ID(__name__), &funcname) < 0)) { return NULL; } @@ -479,7 +479,7 @@ instancemethod_repr(PyObject *self) return NULL; } - if (_PyObject_LookupAttr(func, &_Py_ID(__name__), &funcname) < 0) { + if (PyObject_GetOptionalAttr(func, &_Py_ID(__name__), &funcname) < 0) { return NULL; } if (funcname != NULL && !PyUnicode_Check(funcname)) { |