From d51b259b31a4ca2fa81bf9d0644d365be8387a6a Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 21 Mar 2010 19:35:39 +0000 Subject: [PATCH] remove pointless condition --- Python/ceval.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index c0c00688074..b1d73462f90 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3115,23 +3115,21 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, else if (cmp < 0) goto fail; } - if (j >= co->co_argcount) { - if (kwdict == NULL) { - PyObject *kwd_str = kwd_as_string(keyword); - if (kwd_str) { - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected " - "keyword argument '%.400s'", - PyString_AsString(co->co_name), - PyString_AsString(kwd_str)); - Py_DECREF(kwd_str); - } - goto fail; + if (kwdict == NULL) { + PyObject *kwd_str = kwd_as_string(keyword); + if (kwd_str) { + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected " + "keyword argument '%.400s'", + PyString_AsString(co->co_name), + PyString_AsString(kwd_str)); + Py_DECREF(kwd_str); } - PyDict_SetItem(kwdict, keyword, value); - continue; + goto fail; } -kw_found: + PyDict_SetItem(kwdict, keyword, value); + continue; + kw_found: if (GETLOCAL(j) != NULL) { PyObject *kwd_str = kwd_as_string(keyword); if (kwd_str) {