From fe32493b0b97c2614cb482d582e835ea24526cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Sun, 21 Jan 2024 10:13:36 +0000 Subject: [PATCH] [3.11] Normalize exception (cherry picked from commit f0185e3e0a) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérome Perrin --- Python/pythonrun.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d3c0c85680e17b..fca8b7ab661a35 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);