Skip to content

Commit 92cba78

Browse files
author
guido.van.rossum
committed
Add the test from issue 1704621 (the issue itself is already fixed here).
git-svn-id: http://svn.python.org/projects/python/trunk@58956 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 92bdd26 commit 92cba78

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/seq_tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,13 @@ def test_repeat(self):
306306
self.assertEqual(self.type2test(s)*(-4), self.type2test([]))
307307
self.assertEqual(id(s), id(s*1))
308308

309+
def test_bigrepeat(self):
310+
x = self.type2test([0])
311+
x *= 2**16
312+
self.assertRaises(MemoryError, x.__mul__, 2**16)
313+
if hasattr(x, '__imul__'):
314+
self.assertRaises(MemoryError, x.__imul__, 2**16)
315+
309316
def test_subscript(self):
310317
a = self.type2test([10, 11])
311318
self.assertEqual(a.__getitem__(0L), 10)

0 commit comments

Comments
 (0)