Skip to content

Commit 3bd4c3a

Browse files
authored
[3.11] gh-113358 Fix rendering tracebacks with exceptions with a broken __getattr__ : Normalize exception (#114379)
1 parent d2cfb5b commit 3bd4c3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pythonrun.c

+1
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,7 @@ get_exception_notes(struct exception_print_context *ctx, PyObject *value, PyObje
12061206
if (_PyObject_LookupAttr(value, &_Py_ID(__notes__), notes) < 0) {
12071207
PyObject *type, *errvalue, *tback;
12081208
PyErr_Fetch(&type, &errvalue, &tback);
1209+
PyErr_NormalizeException(&type, &errvalue, &tback);
12091210
note = PyUnicode_FromFormat("Ignored error getting __notes__: %R", errvalue);
12101211
Py_XDECREF(type);
12111212
Py_XDECREF(errvalue);

0 commit comments

Comments
 (0)