Skip to content
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into bpo-45711-remove-ex…
…c_type_field
  • Loading branch information
iritkatriel committed Nov 22, 2021
commit bc889bce6858f2426de7ad54a993ba073e48525a
24 changes: 3 additions & 21 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -3720,27 +3720,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
ASSERT_EXC_TYPE_IS_REDUNDANT(TOP(), SECOND());
PyObject *left = SECOND();
assert(PyExceptionInstance_Check(left));

if (PyTuple_Check(right)) {
Py_ssize_t i, length;
length = PyTuple_GET_SIZE(right);
for (i = 0; i < length; i++) {
PyObject *exc = PyTuple_GET_ITEM(right, i);
if (!PyExceptionClass_Check(exc)) {
_PyErr_SetString(tstate, PyExc_TypeError,
cannot_catch_msg);
Py_DECREF(right);
goto error;
}
}
}
else {
if (!PyExceptionClass_Check(right)) {
_PyErr_SetString(tstate, PyExc_TypeError,
cannot_catch_msg);
Py_DECREF(right);
goto error;
}
if (check_except_type_valid(tstate, right) < 0) {
Py_DECREF(right);
goto error;
}
int res = PyErr_GivenExceptionMatches(left, right);
Py_DECREF(right);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.