We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BaseExceptionGroup_repr()
1 parent 9cba6b6 commit d61e6b9Copy full SHA for d61e6b9
1 file changed
Objects/exceptions.c
@@ -1088,8 +1088,11 @@ BaseExceptionGroup_repr(PyObject *op)
1088
1089
PyObject *exceptions_str = NULL;
1090
1091
- /* If the initial exceptions string was not saved in the constructor. */
1092
- if (!self->excs_str) {
+ /* Use the saved exceptions string for custom sequences. */
+ if (self->excs_str) {
1093
+ exceptions_str = Py_NewRef(self->excs_str);
1094
+ }
1095
+ else {
1096
assert(self->excs);
1097
1098
/* Older versions delegated to BaseException, inserting the current
@@ -1113,9 +1116,6 @@ BaseExceptionGroup_repr(PyObject *op)
1113
1116
return NULL;
1114
1117
}
1115
1118
- else {
- exceptions_str = Py_NewRef(self->excs_str);
- }
1119
1120
assert(exceptions_str != NULL);
1121
0 commit comments