summaryrefslogtreecommitdiffstats
path: root/Objects/unionobject.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/unionobject.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/unionobject.c')
-rw-r--r--Objects/unionobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/unionobject.c b/Objects/unionobject.c
index f509a16..269f469 100644
--- a/Objects/unionobject.c
+++ b/Objects/unionobject.c
@@ -194,13 +194,13 @@ union_repr_item(_PyUnicodeWriter *writer, PyObject *p)
return _PyUnicodeWriter_WriteASCIIString(writer, "None", 4);
}
- if (_PyObject_LookupAttr(p, &_Py_ID(__origin__), &tmp) < 0) {
+ if (PyObject_GetOptionalAttr(p, &_Py_ID(__origin__), &tmp) < 0) {
goto exit;
}
if (tmp) {
Py_DECREF(tmp);
- if (_PyObject_LookupAttr(p, &_Py_ID(__args__), &tmp) < 0) {
+ if (PyObject_GetOptionalAttr(p, &_Py_ID(__args__), &tmp) < 0) {
goto exit;
}
if (tmp) {
@@ -210,13 +210,13 @@ union_repr_item(_PyUnicodeWriter *writer, PyObject *p)
}
}
- if (_PyObject_LookupAttr(p, &_Py_ID(__qualname__), &qualname) < 0) {
+ if (PyObject_GetOptionalAttr(p, &_Py_ID(__qualname__), &qualname) < 0) {
goto exit;
}
if (qualname == NULL) {
goto use_repr;
}
- if (_PyObject_LookupAttr(p, &_Py_ID(__module__), &module) < 0) {
+ if (PyObject_GetOptionalAttr(p, &_Py_ID(__module__), &module) < 0) {
goto exit;
}
if (module == NULL || module == Py_None) {