diff options
author | Raymond Hettinger <python@rcn.com> | 2009-11-01 18:43:31 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-11-01 18:43:31 (GMT) |
commit | 4da5faae212b31bf24efcc72e03a1484166a2917 (patch) | |
tree | dcce524b48a99792476e57dfd9376457a076b7f4 /Modules | |
parent | 6da85f947f0c03a9fde7de4a9386498be8eaaa94 (diff) | |
download | cpython-4da5faae212b31bf24efcc72e03a1484166a2917.zip cpython-4da5faae212b31bf24efcc72e03a1484166a2917.tar.gz cpython-4da5faae212b31bf24efcc72e03a1484166a2917.tar.bz2 |
Issue 7244: Fix indentation in C code. Fix test to not sent output to stdout.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/itertoolsmodule.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index ecd5e17..23c219e 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -3407,26 +3407,26 @@ izip_longest_next(iziplongestobject *lz) Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - if (it == NULL) { - Py_INCREF(lz->fillvalue); - item = lz->fillvalue; + if (it == NULL) { + Py_INCREF(lz->fillvalue); + item = lz->fillvalue; + } else { + assert(PyIter_Check(it)); + item = PyIter_Next(it); + if (item == NULL) { + lz->numactive -= 1; + if (lz->numactive == 0 || PyErr_Occurred()) { + lz->numactive = 0; + Py_DECREF(result); + return NULL; } else { - assert(PyIter_Check(it)); - item = PyIter_Next(it); - if (item == NULL) { - lz->numactive -= 1; - if (lz->numactive == 0 || PyErr_Occurred()) { - lz->numactive = 0; - Py_DECREF(result); - return NULL; - } else { - Py_INCREF(lz->fillvalue); - item = lz->fillvalue; - PyTuple_SET_ITEM(lz->ittuple, i, NULL); - Py_DECREF(it); - } - } + Py_INCREF(lz->fillvalue); + item = lz->fillvalue; + PyTuple_SET_ITEM(lz->ittuple, i, NULL); + Py_DECREF(it); } + } + } olditem = PyTuple_GET_ITEM(result, i); PyTuple_SET_ITEM(result, i, item); Py_DECREF(olditem); @@ -3437,26 +3437,26 @@ izip_longest_next(iziplongestobject *lz) return NULL; for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); - if (it == NULL) { - Py_INCREF(lz->fillvalue); - item = lz->fillvalue; - } else { - assert(PyIter_Check(it)); - item = PyIter_Next(it); - if (item == NULL) { - lz->numactive -= 1; - if (lz->numactive == 0 || PyErr_Occurred()) { - lz->numactive = 0; - Py_DECREF(result); - return NULL; - } else { - Py_INCREF(lz->fillvalue); - item = lz->fillvalue; - PyTuple_SET_ITEM(lz->ittuple, i, NULL); - Py_DECREF(it); - } - } - } + if (it == NULL) { + Py_INCREF(lz->fillvalue); + item = lz->fillvalue; + } else { + assert(PyIter_Check(it)); + item = PyIter_Next(it); + if (item == NULL) { + lz->numactive -= 1; + if (lz->numactive == 0 || PyErr_Occurred()) { + lz->numactive = 0; + Py_DECREF(result); + return NULL; + } else { + Py_INCREF(lz->fillvalue); + item = lz->fillvalue; + PyTuple_SET_ITEM(lz->ittuple, i, NULL); + Py_DECREF(it); + } + } + } PyTuple_SET_ITEM(result, i, item); } } |