diff --git a/Python/ceval.c b/Python/ceval.c index e59c39ddd7e..d28ae2ba051 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3333,7 +3333,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, keyword); goto fail; } - PyDict_SetItem(kwdict, keyword, value); + if (PyDict_SetItem(kwdict, keyword, value) == -1) { + goto fail; + } continue; kw_found: if (GETLOCAL(j) != NULL) {