summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-12 05:57:10 (GMT)
committerGitHub <noreply@github.com>2023-07-12 05:57:10 (GMT)
commitbe1b968dc1e63c3c68e161ddc5a05eb064833440 (patch)
tree8689ba9f656854b83bf24b82de4fc471437a51ab /Objects/classobject.c
parente8ab0096a583184fe24dfbc39eff70d270c8e6f4 (diff)
downloadcpython-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.c6
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)) {