summaryrefslogtreecommitdiffstats
path: root/Modules/_functoolsmodule.c
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-08-16 19:46:32 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-08-16 19:46:32 (GMT)
commit7a9bdbc1c2214bec2133139dd8830f17e0383eed (patch)
treea332279d11accbf9106fb82bed646eaff4769773 /Modules/_functoolsmodule.c
parent5b37ce64c1a8108406cd0ae19e15b9ebd855c2f6 (diff)
downloadcpython-7a9bdbc1c2214bec2133139dd8830f17e0383eed.zip
cpython-7a9bdbc1c2214bec2133139dd8830f17e0383eed.tar.gz
cpython-7a9bdbc1c2214bec2133139dd8830f17e0383eed.tar.bz2
Merged revisions 84098 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84098 | alexander.belopolsky | 2010-08-16 14:55:46 -0400 (Mon, 16 Aug 2010) | 4 lines Issue #665761: functools.reduce() will no longer mask exceptions other than TypeError raised by the iterator argument. Also added a test to check that zip() already behaves similarly. ........
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r--Modules/_functoolsmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index bf2ea3b..3437353 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -302,8 +302,9 @@ functools_reduce(PyObject *self, PyObject *args)
it = PyObject_GetIter(seq);
if (it == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "reduce() arg 2 must support iteration");
+ if (PyErr_ExceptionMatches(PyExc_TypeError))
+ PyErr_SetString(PyExc_TypeError,
+ "reduce() arg 2 must support iteration");
Py_XDECREF(result);
return NULL;
}