Skip to content

Commit 2f0e336

Browse files
Fix BaseExceptionGroup repr
1 parent bcdf231 commit 2f0e336

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ BaseExceptionGroup_repr(PyObject *op)
10911091
* value of self.args[1]; but this can be mutable and go out-of-sync
10921092
* with self.exceptions. Instead, use self.exceptions for accuracy,
10931093
* making it look like self.args[1] for backwards compatibility. */
1094-
if (PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
1094+
if (PyTuple_GET_SIZE(self->args) == 2 && PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
10951095
PyObject *exceptions_list = PySequence_List(self->excs);
10961096
if (!exceptions_list) {
10971097
return NULL;

0 commit comments

Comments
 (0)