[Python-checkins] cpython: _PyEval_EvalCodeWithName(): remove redundant check

victor.stinner python-checkins at python.org
Tue Jan 10 20:17:39 EST 2017


https://hg.python.org/cpython/rev/c42c422f34b3
changeset:   106084:c42c422f34b3
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Jan 11 02:12:06 2017 +0100
summary:
  _PyEval_EvalCodeWithName(): remove redundant check

Replace the runtime check with an assertion (just in case).

files:
  Python/ceval.c |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4017,7 +4017,8 @@
             }
         }
 
-        if (j >= total_args && kwdict == NULL) {
+        assert(j >= total_args);
+        if (kwdict == NULL) {
             PyErr_Format(PyExc_TypeError,
                          "%U() got an unexpected keyword argument '%S'",
                          co->co_name, keyword);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list