summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-02-07 23:57:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-02-07 23:57:05 (GMT)
commit9f0e1ea96402bf6fa72560640777bf8c3bd186fb (patch)
tree8afe516eec3490fd24da7bdb3a2479ec0688c8ce /Lib
parentbbe92887ced108cb7ffac2fa037e72981920f21f (diff)
downloadcpython-9f0e1ea96402bf6fa72560640777bf8c3bd186fb.zip
cpython-9f0e1ea96402bf6fa72560640777bf8c3bd186fb.tar.gz
cpython-9f0e1ea96402bf6fa72560640777bf8c3bd186fb.tar.bz2
Do not let overflows in enumerate() and count() pass silently.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_itertools.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 5e375c9..c965d4c 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -52,8 +52,7 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(take(2, zip('abc',count(3))), [('a', 3), ('b', 4)])
self.assertRaises(TypeError, count, 2, 3)
self.assertRaises(TypeError, count, 'a')
- c = count(sys.maxint-2) # verify that rollover doesn't crash
- c.next(); c.next(); c.next(); c.next(); c.next()
+ self.assertRaises(OverflowError, list, islice(count(sys.maxint-5), 10))
c = count(3)
self.assertEqual(repr(c), 'count(3)')
c.next()