Fix space/tabs issue.

This commit is contained in:
Raymond Hettinger 2009-11-01 20:05:41 +00:00
parent 4da5faae21
commit 743d8319ef
1 changed files with 61 additions and 61 deletions

View File

@ -3392,75 +3392,75 @@ izip_longest_traverse(iziplongestobject *lz, visitproc visit, void *arg)
static PyObject * static PyObject *
izip_longest_next(iziplongestobject *lz) izip_longest_next(iziplongestobject *lz)
{ {
Py_ssize_t i; Py_ssize_t i;
Py_ssize_t tuplesize = lz->tuplesize; Py_ssize_t tuplesize = lz->tuplesize;
PyObject *result = lz->result; PyObject *result = lz->result;
PyObject *it; PyObject *it;
PyObject *item; PyObject *item;
PyObject *olditem; PyObject *olditem;
if (tuplesize == 0) if (tuplesize == 0)
return NULL; return NULL;
if (lz->numactive == 0) if (lz->numactive == 0)
return NULL; return NULL;
if (Py_REFCNT(result) == 1) { if (Py_REFCNT(result) == 1) {
Py_INCREF(result); Py_INCREF(result);
for (i=0 ; i < tuplesize ; i++) { for (i=0 ; i < tuplesize ; i++) {
it = PyTuple_GET_ITEM(lz->ittuple, i); it = PyTuple_GET_ITEM(lz->ittuple, i);
if (it == NULL) { if (it == NULL) {
Py_INCREF(lz->fillvalue); Py_INCREF(lz->fillvalue);
item = 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 { } else {
Py_INCREF(lz->fillvalue); assert(PyIter_Check(it));
item = lz->fillvalue; item = PyIter_Next(it);
PyTuple_SET_ITEM(lz->ittuple, i, NULL); if (item == NULL) {
Py_DECREF(it); 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);
}
}
} }
olditem = PyTuple_GET_ITEM(result, i);
PyTuple_SET_ITEM(result, i, item);
Py_DECREF(olditem);
} }
} } else {
olditem = PyTuple_GET_ITEM(result, i); result = PyTuple_New(tuplesize);
PyTuple_SET_ITEM(result, i, item); if (result == NULL)
Py_DECREF(olditem);
}
} else {
result = PyTuple_New(tuplesize);
if (result == NULL)
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; return NULL;
} else { for (i=0 ; i < tuplesize ; i++) {
Py_INCREF(lz->fillvalue); it = PyTuple_GET_ITEM(lz->ittuple, i);
item = lz->fillvalue; if (it == NULL) {
PyTuple_SET_ITEM(lz->ittuple, i, NULL); Py_INCREF(lz->fillvalue);
Py_DECREF(it); 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);
} }
} }
PyTuple_SET_ITEM(result, i, item); return result;
}
}
return result;
} }
PyDoc_STRVAR(izip_longest_doc, PyDoc_STRVAR(izip_longest_doc,