https://github.com/python/cpython/commit/3bd4c3a86cc4739f57ea5d6d580b536a0b87fb3f
commit: 3bd4c3a86cc4739f57ea5d6d580b536a0b87fb3f
branch: 3.11
author: Jérome Perrin <[email protected]>
committer: iritkatriel <[email protected]>
date: 2024-01-21T17:25:55Z
summary:

 [3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken 
__getattr__ : Normalize exception  (#114379)

files:
M Python/pythonrun.c

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);

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to