summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-04-06 19:55:12 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-04-06 19:55:12 (GMT)
commitee57f159afcba5aeca24a064a114ab441419a820 (patch)
treee950a43a52d0e87bbaad971078fabdb036c21041 /Python/bltinmodule.c
parent710b5f0b2452accf3495556b8bdc614699e6f544 (diff)
parent278d03bd66e40d57168ff66c6fb79eae599a784d (diff)
downloadcpython-ee57f159afcba5aeca24a064a114ab441419a820.zip
cpython-ee57f159afcba5aeca24a064a114ab441419a820.tar.gz
cpython-ee57f159afcba5aeca24a064a114ab441419a820.tar.bz2
Revert a premature patch for issue #14010 (changeset 846bd418aee5).
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 6344c68..a486b49 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -391,11 +391,9 @@ static void
filter_dealloc(filterobject *lz)
{
PyObject_GC_UnTrack(lz);
- Py_TRASHCAN_SAFE_BEGIN(lz)
Py_XDECREF(lz->func);
Py_XDECREF(lz->it);
Py_TYPE(lz)->tp_free(lz);
- Py_TRASHCAN_SAFE_END(lz)
}
static int
@@ -416,10 +414,7 @@ filter_next(filterobject *lz)
iternext = *Py_TYPE(it)->tp_iternext;
for (;;) {
- if (Py_EnterRecursiveCall(" while iterating"))
- return NULL;
item = iternext(it);
- Py_LeaveRecursiveCall();
if (item == NULL)
return NULL;
@@ -1036,11 +1031,9 @@ static void
map_dealloc(mapobject *lz)
{
PyObject_GC_UnTrack(lz);
- Py_TRASHCAN_SAFE_BEGIN(lz)
Py_XDECREF(lz->iters);
Py_XDECREF(lz->func);
Py_TYPE(lz)->tp_free(lz);
- Py_TRASHCAN_SAFE_END(lz)
}
static int
@@ -2227,11 +2220,9 @@ static void
zip_dealloc(zipobject *lz)
{
PyObject_GC_UnTrack(lz);
- Py_TRASHCAN_SAFE_BEGIN(lz)
Py_XDECREF(lz->ittuple);
Py_XDECREF(lz->result);
Py_TYPE(lz)->tp_free(lz);
- Py_TRASHCAN_SAFE_END(lz)
}
static int
@@ -2254,15 +2245,15 @@ zip_next(zipobject *lz)
if (tuplesize == 0)
return NULL;
- if (Py_EnterRecursiveCall(" while iterating"))
- return NULL;
if (Py_REFCNT(result) == 1) {
Py_INCREF(result);
for (i=0 ; i < tuplesize ; i++) {
it = PyTuple_GET_ITEM(lz->ittuple, i);
item = (*Py_TYPE(it)->tp_iternext)(it);
- if (item == NULL)
- goto error;
+ if (item == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
olditem = PyTuple_GET_ITEM(result, i);
PyTuple_SET_ITEM(result, i, item);
Py_DECREF(olditem);
@@ -2270,21 +2261,18 @@ zip_next(zipobject *lz)
} else {
result = PyTuple_New(tuplesize);
if (result == NULL)
- goto error;
+ return NULL;
for (i=0 ; i < tuplesize ; i++) {
it = PyTuple_GET_ITEM(lz->ittuple, i);
item = (*Py_TYPE(it)->tp_iternext)(it);
- if (item == NULL)
- goto error;
+ if (item == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
PyTuple_SET_ITEM(result, i, item);
}
}
- Py_LeaveRecursiveCall();
return result;
-error:
- Py_XDECREF(result);
- Py_LeaveRecursiveCall();
- return NULL;
}
static PyObject *