summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_deque.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-01-08 18:09:20 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-01-08 18:09:20 (GMT)
commit51c2f6cd180df4acd4eec6317b46ef38a2bebe16 (patch)
tree1098d156e970c0db414adaddce61b8b7888f6199 /Lib/test/test_deque.py
parent1812f8cf3f47659a49712a3e2d633e82d1f09915 (diff)
downloadcpython-51c2f6cd180df4acd4eec6317b46ef38a2bebe16.zip
cpython-51c2f6cd180df4acd4eec6317b46ef38a2bebe16.tar.gz
cpython-51c2f6cd180df4acd4eec6317b46ef38a2bebe16.tar.bz2
Fix zero-length corner case for iterating over a mutating deque.
Diffstat (limited to 'Lib/test/test_deque.py')
-rw-r--r--Lib/test/test_deque.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index a562922..35e1536 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -396,6 +396,12 @@ class TestVariousIteratorArgs(unittest.TestCase):
d.pop()
self.assertRaises(RuntimeError, it.next)
+ def test_runtime_error_on_empty_deque(self):
+ d = deque()
+ it = iter(d)
+ d.append(10)
+ self.assertRaises(RuntimeError, it.next)
+
class Deque(deque):
pass