From 3bd4c3a86cc4739f57ea5d6d580b536a0b87fb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Mon, 22 Jan 2024 02:25:55 +0900 Subject: [3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken __getattr__ : Normalize exception (#114379) --- Python/pythonrun.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d3c0c85..fca8b7a 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); -- cgit v0.12