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
1 parent f93ae8f commit 56eefeeCopy full SHA for 56eefee
Objects/exceptions.c
@@ -1073,12 +1073,17 @@ BaseExceptionGroup_repr(PyObject *op)
1073
PyObject* excs_orig = PyTuple_GET_ITEM(self->args, 1);
1074
if (PyList_Check(excs_orig)) {
1075
excs_orig = PySequence_List(self->excs);
1076
+ } else {
1077
+ Py_INCREF(excs_orig);
1078
}
1079
1080
const char *name = _PyType_Name(Py_TYPE(self));
- return PyUnicode_FromFormat(
1081
+ PyObject *repr = PyUnicode_FromFormat(
1082
"%s(%R, %R)", name,
1083
self->msg, excs_orig);
1084
+
1085
+ Py_DECREF(excs_orig);
1086
+ return repr;
1087
1088
1089
/*[clinic input]
0 commit comments