diff options
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; } |