_PyEval_EvalCodeWithName(): remove redundant check

Replace the runtime check with an assertion (just in case).
This commit is contained in:
Victor Stinner 2017-01-11 02:12:06 +01:00
parent b915bc354e
commit 231d1f3439
1 changed files with 2 additions and 1 deletions

View File

@ -4017,7 +4017,8 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
} }
} }
if (j >= total_args && kwdict == NULL) { assert(j >= total_args);
if (kwdict == NULL) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%U() got an unexpected keyword argument '%S'", "%U() got an unexpected keyword argument '%S'",
co->co_name, keyword); co->co_name, keyword);