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.
1 parent bcdf231 commit 2f0e336Copy full SHA for 2f0e336
1 file changed
Objects/exceptions.c
@@ -1091,7 +1091,7 @@ BaseExceptionGroup_repr(PyObject *op)
1091
* value of self.args[1]; but this can be mutable and go out-of-sync
1092
* with self.exceptions. Instead, use self.exceptions for accuracy,
1093
* making it look like self.args[1] for backwards compatibility. */
1094
- if (PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
+ if (PyTuple_GET_SIZE(self->args) == 2 && PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
1095
PyObject *exceptions_list = PySequence_List(self->excs);
1096
if (!exceptions_list) {
1097
return NULL;
0 commit comments