mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -953,7 +953,7 @@ print_exception_file_and_line(struct exception_print_context *ctx,
|
|||
PyObject *f = ctx->file;
|
||||
|
||||
PyObject *tmp;
|
||||
int res = _PyObject_LookupAttr(*value_p, &_Py_ID(print_file_and_line), &tmp);
|
||||
int res = PyObject_GetOptionalAttr(*value_p, &_Py_ID(print_file_and_line), &tmp);
|
||||
if (res <= 0) {
|
||||
if (res < 0) {
|
||||
PyErr_Clear();
|
||||
|
@ -1132,7 +1132,7 @@ print_exception_notes(struct exception_print_context *ctx, PyObject *value)
|
|||
}
|
||||
|
||||
PyObject *notes;
|
||||
int res = _PyObject_LookupAttr(value, &_Py_ID(__notes__), ¬es);
|
||||
int res = PyObject_GetOptionalAttr(value, &_Py_ID(__notes__), ¬es);
|
||||
if (res <= 0) {
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue