cpython: 7924eac912fe (original) (raw)
Mercurial > cpython
changeset 102843:7924eac912fe
Issue #27809: Cleanup _PyEval_EvalCodeWithName() * Rename nm to name * PEP 7: add { ... } to if/else blocks [#27809]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Mon, 22 Aug 2016 23:17:30 +0200 |
parents | 1aefb4c4a7b4 |
children | 15eab21bf934 |
files | Python/ceval.c |
diffstat | 1 files changed, 13 insertions(+), 15 deletions(-)[+] [-] Python/ceval.c 28 |
line wrap: on
line diff
--- a/Python/ceval.c +++ b/Python/ceval.c @@ -3878,28 +3878,28 @@ static PyObject * normally interned this should almost always hit. */ co_varnames = ((PyTupleObject *)(co->co_varnames))->ob_item; for (j = 0; j < total_args; j++) {
PyObject *nm = co_varnames[j];[](#l1.7)
if (nm == keyword)[](#l1.8)
PyObject *name = co_varnames[j];[](#l1.9)
if (name == keyword) {[](#l1.10) goto kw_found;[](#l1.11)
}[](#l1.12) }[](#l1.13)
/* Slow fallback, just in case */ for (j = 0; j < total_args; j++) {
PyObject *nm = co_varnames[j];[](#l1.17)
int cmp = PyObject_RichCompareBool([](#l1.18)
keyword, nm, Py_EQ);[](#l1.19)
if (cmp > 0)[](#l1.20)
PyObject *name = co_varnames[j];[](#l1.21)
int cmp = PyObject_RichCompareBool( keyword, name, Py_EQ);[](#l1.22)
if (cmp > 0) {[](#l1.23) goto kw_found;[](#l1.24)
else if (cmp < 0)[](#l1.25)
}[](#l1.26)
else if (cmp < 0) {[](#l1.27) goto fail;[](#l1.28)
}[](#l1.29) }[](#l1.30)
if (j >= total_args && kwdict == NULL) { PyErr_Format(PyExc_TypeError,
"%U() got an unexpected "[](#l1.34)
"keyword argument '%S'",[](#l1.35)
co->co_name,[](#l1.36)
keyword);[](#l1.37)
"%U() got an unexpected keyword argument '%S'",[](#l1.38)
co->co_name, keyword);[](#l1.39) goto fail;[](#l1.40) }[](#l1.41)
@@ -3911,10 +3911,8 @@ static PyObject * kw_found: if (GETLOCAL(j) != NULL) { PyErr_Format(PyExc_TypeError,
"%U() got multiple "[](#l1.47)
"values for argument '%S'",[](#l1.48)
co->co_name,[](#l1.49)
keyword);[](#l1.50)
"%U() got multiple values for argument '%S'",[](#l1.51)
co->co_name, keyword);[](#l1.52) goto fail;[](#l1.53) }[](#l1.54) Py_INCREF(value);[](#l1.55)