gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)

This commit is contained in:
Serhiy Storchaka 2023-07-12 08:57:10 +03:00 committed by GitHub
parent e8ab0096a5
commit be1b968dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 351 additions and 352 deletions

View file

@ -1748,7 +1748,7 @@ PyErr_SyntaxLocationObjectEx(PyObject *filename, int lineno, int col_offset,
}
}
if ((PyObject *)Py_TYPE(exc) != PyExc_SyntaxError) {
if (_PyObject_LookupAttr(exc, &_Py_ID(msg), &tmp) < 0) {
if (PyObject_GetOptionalAttr(exc, &_Py_ID(msg), &tmp) < 0) {
_PyErr_Clear(tstate);
}
else if (tmp) {
@ -1767,7 +1767,7 @@ PyErr_SyntaxLocationObjectEx(PyObject *filename, int lineno, int col_offset,
}
}
if (_PyObject_LookupAttr(exc, &_Py_ID(print_file_and_line), &tmp) < 0) {
if (PyObject_GetOptionalAttr(exc, &_Py_ID(print_file_and_line), &tmp) < 0) {
_PyErr_Clear(tstate);
}
else if (tmp) {