summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.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/abstract.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/abstract.c')
-rw-r--r--Objects/abstract.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index e595bc9..b4edcec 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -182,7 +182,7 @@ PyObject_GetItem(PyObject *o, PyObject *key)
return Py_GenericAlias(o, key);
}
- if (_PyObject_LookupAttr(o, &_Py_ID(__class_getitem__), &meth) < 0) {
+ if (PyObject_GetOptionalAttr(o, &_Py_ID(__class_getitem__), &meth) < 0) {
return NULL;
}
if (meth && meth != Py_None) {
@@ -2552,7 +2552,7 @@ abstract_get_bases(PyObject *cls)
{
PyObject *bases;
- (void)_PyObject_LookupAttr(cls, &_Py_ID(__bases__), &bases);
+ (void)PyObject_GetOptionalAttr(cls, &_Py_ID(__bases__), &bases);
if (bases != NULL && !PyTuple_Check(bases)) {
Py_DECREF(bases);
return NULL;
@@ -2636,7 +2636,7 @@ object_isinstance(PyObject *inst, PyObject *cls)
if (PyType_Check(cls)) {
retval = PyObject_TypeCheck(inst, (PyTypeObject *)cls);
if (retval == 0) {
- retval = _PyObject_LookupAttr(inst, &_Py_ID(__class__), &icls);
+ retval = PyObject_GetOptionalAttr(inst, &_Py_ID(__class__), &icls);
if (icls != NULL) {
if (icls != (PyObject *)(Py_TYPE(inst)) && PyType_Check(icls)) {
retval = PyType_IsSubtype(
@@ -2654,7 +2654,7 @@ object_isinstance(PyObject *inst, PyObject *cls)
if (!check_class(cls,
"isinstance() arg 2 must be a type, a tuple of types, or a union"))
return -1;
- retval = _PyObject_LookupAttr(inst, &_Py_ID(__class__), &icls);
+ retval = PyObject_GetOptionalAttr(inst, &_Py_ID(__class__), &icls);
if (icls != NULL) {
retval = abstract_issubclass(icls, cls);
Py_DECREF(icls);