From: Jérome Perrin Date: Sun, 21 Jan 2024 17:25:55 +0000 (+0900) Subject: [3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken __getattr__... X-Git-Tag: v3.11.8~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bd4c3a86cc4739f57ea5d6d580b536a0b87fb3f;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken __getattr__ : Normalize exception (#114379) --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d3c0c85680e1..fca8b7ab661a 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1206,6 +1206,7 @@ get_exception_notes(struct exception_print_context *ctx, PyObject *value, PyObje if (_PyObject_LookupAttr(value, &_Py_ID(__notes__), notes) < 0) { PyObject *type, *errvalue, *tback; PyErr_Fetch(&type, &errvalue, &tback); + PyErr_NormalizeException(&type, &errvalue, &tback); note = PyUnicode_FromFormat("Ignored error getting __notes__: %R", errvalue); Py_XDECREF(type); Py_XDECREF(errvalue);