]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken __getattr__...
authorJérome Perrin <perrinjerome@gmail.com>
Sun, 21 Jan 2024 17:25:55 +0000 (02:25 +0900)
committerGitHub <noreply@github.com>
Sun, 21 Jan 2024 17:25:55 +0000 (17:25 +0000)
Python/pythonrun.c

index d3c0c85680e17b813de8a9a74e4ffcc5dbd48270..fca8b7ab661a35d3ee786a6645ec816f453fa1db 100644 (file)
@@ -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);