diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-07-12 05:57:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 05:57:10 (GMT) |
commit | be1b968dc1e63c3c68e161ddc5a05eb064833440 (patch) | |
tree | 8689ba9f656854b83bf24b82de4fc471437a51ab /Python/pythonrun.c | |
parent | e8ab0096a583184fe24dfbc39eff70d270c8e6f4 (diff) | |
download | cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.zip cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.gz cpython-be1b968dc1e63c3c68e161ddc5a05eb064833440.tar.bz2 |
gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 60bf66c..721c527 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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; } |