mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +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
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue