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.
........
This commit is contained in:
Alexander Belopolsky 2010-08-16 19:46:32 +00:00
parent 5b37ce64c1
commit 7a9bdbc1c2
4 changed files with 26 additions and 8 deletions

View file

@ -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;
}