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 18:55:46 +00:00
parent 27354ccec9
commit e29e6bffb5
4 changed files with 26 additions and 8 deletions

View file

@ -1234,6 +1234,7 @@ class BuiltinTest(unittest.TestCase):
class G:
pass
self.assertRaises(TypeError, zip, a, G())
self.assertRaises(RuntimeError, zip, a, TestFailingIter())
# Make sure zip doesn't try to allocate a billion elements for the
# result list when one of its arguments doesn't say how long it is.