Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 231d1f3

Browse files
committed
_PyEval_EvalCodeWithName(): remove redundant check
Replace the runtime check with an assertion (just in case).
1 parent b915bc3 commit 231d1f3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4017,7 +4017,8 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
40174017
}
40184018
}
40194019

4020-
if (j >= total_args && kwdict == NULL) {
4020+
assert(j >= total_args);
4021+
if (kwdict == NULL) {
40214022
PyErr_Format(PyExc_TypeError,
40224023
"%U() got an unexpected keyword argument '%S'",
40234024
co->co_name, keyword);

0 commit comments

Comments
 (0)