correctly overflow when indexes are too large

This commit is contained in:
Benjamin Peterson 2010-06-07 22:23:23 +00:00
parent 0b41707dde
commit 13e934acc0
3 changed files with 10 additions and 0 deletions

View file

@ -1282,6 +1282,9 @@ class UnicodeTest(
self.assertRaises(IndexError, u"{:}".format)
self.assertRaises(IndexError, u"{:s}".format)
self.assertRaises(IndexError, u"{}".format)
big = "23098475029384702983476098230754973209482573"
self.assertRaises(ValueError, ("{" + big + "}").format)
self.assertRaises(ValueError, ("{[" + big + "]}").format, [0])
# issue 6089
self.assertRaises(ValueError, u"{0[0]x}".format, [None])