Commit 7588b8b3 authored by Benjamin Peterson's avatar Benjamin Peterson

nest if for clarity

parent afcee8b7
...@@ -3155,18 +3155,18 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, ...@@ -3155,18 +3155,18 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
} }
if (co->co_kwonlyargcount > 0) { if (co->co_kwonlyargcount > 0) {
for (i = co->co_argcount; i < total_args; i++) { for (i = co->co_argcount; i < total_args; i++) {
PyObject *name, *def; PyObject *name;
if (GETLOCAL(i) != NULL) if (GETLOCAL(i) != NULL)
continue; continue;
name = PyTuple_GET_ITEM(co->co_varnames, i); name = PyTuple_GET_ITEM(co->co_varnames, i);
def = NULL; if (kwdefs != NULL) {
if (kwdefs != NULL) PyObject *def = PyDict_GetItem(kwdefs, name);
def = PyDict_GetItem(kwdefs, name); if (def) {
if (def != NULL) {
Py_INCREF(def); Py_INCREF(def);
SETLOCAL(i, def); SETLOCAL(i, def);
continue; continue;
} }
}
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%U() needs keyword-only argument %S", "%U() needs keyword-only argument %S",
co->co_name, name); co->co_name, name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment