summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-21 21:22:12 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-21 21:22:12 (GMT)
commit7588b8b355d81e21ea3d38cdf6b95f27fafa5be6 (patch)
tree9054b576ef60d7ac666eb4c62ca5b69692df25b5 /Python
parentafcee8b78d92a02263ce1eb1015d0933d3e4e377 (diff)
downloadcpython-7588b8b355d81e21ea3d38cdf6b95f27fafa5be6.zip
cpython-7588b8b355d81e21ea3d38cdf6b95f27fafa5be6.tar.gz
cpython-7588b8b355d81e21ea3d38cdf6b95f27fafa5be6.tar.bz2
nest if for clarity
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 0bd785b..4e8557d 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3155,17 +3155,17 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
}
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",