Skip to content

Commit 5fdaa02

Browse files
Add assertion
1 parent 4f9a6ba commit 5fdaa02

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/exceptions.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +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+
assert(PyTuple_Check(self->args));
10941095
if (PyTuple_GET_SIZE(self->args) == 2 && PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
10951096
PyObject *exceptions_list = PySequence_List(self->excs);
10961097
if (!exceptions_list) {

0 commit comments

Comments
 (0)