Skip to content

Commit 733158d

Browse files
committed
bpo-37645: clear exception in check_args_iterable()
1 parent 2a55a9f commit 733158d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Python/ceval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5341,6 +5341,9 @@ static int
53415341
check_args_iterable(PyThreadState *tstate, PyObject *func, PyObject *args)
53425342
{
53435343
if (args->ob_type->tp_iter == NULL && !PySequence_Check(args)) {
5344+
/* check_args_iterable() may be called with a live exception,
5345+
* clear it. */
5346+
PyErr_Clear();
53445347
PyObject *funcstr = PyObject_FunctionStr(func);
53455348
if (funcstr != NULL) {
53465349
_PyErr_Format(tstate, PyExc_TypeError,

0 commit comments

Comments
 (0)