Merged revisions 81820 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line

  correctly overflow when indexes are too large
........
This commit is contained in:
Benjamin Peterson 2010-06-07 22:31:26 +00:00
parent 5b92772e24
commit 59a1b2f732
3 changed files with 10 additions and 0 deletions

View file

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