Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 59863:3833cf33ca61
nest if for clarity
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sun, 21 Mar 2010 21:22:12 +0000 |
| parents | d0bdd0985637 |
| children | 04e775b33e9e |
line wrap: on
line diff
--- a/Python/ceval.c Sun Mar 21 21:16:24 2010 +0000 +++ b/Python/ceval.c Sun Mar 21 21:22:12 2010 +0000 @@ -3155,17 +3155,17 @@ } if (co->co_kwonlyargcount > 0) { for (i = co->co_argcount; i < total_args; i++) { - PyObject *name, *def; + PyObject *name; if (GETLOCAL(i) != NULL) continue; name = PyTuple_GET_ITEM(co->co_varnames, i); - def = NULL; - if (kwdefs != NULL) - def = PyDict_GetItem(kwdefs, name); - if (def != NULL) { - Py_INCREF(def); - SETLOCAL(i, def); - continue; + if (kwdefs != NULL) { + PyObject *def = PyDict_GetItem(kwdefs, name); + if (def) { + Py_INCREF(def); + SETLOCAL(i, def); + continue; + } } PyErr_Format(PyExc_TypeError, "%U() needs keyword-only argument %S",
