mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Change formatchar(), so that u"%c" % 0xffffffff now raises
an OverflowError instead of a TypeError to be consistent with "%c" % 256. See SF patch #710127.
This commit is contained in:
parent
7ba256f039
commit
44f527fea4
3 changed files with 5 additions and 4 deletions
|
@ -360,7 +360,7 @@ class UnicodeTest(
|
|||
self.assertEqual(u"%(x)s, %(\xfc)s" % {'x':u"abc", u'\xfc':"def"}, u'abc, def')
|
||||
|
||||
self.assertEqual(u'%c' % 0x1234, u'\u1234')
|
||||
self.assertRaises(ValueError, u"%c".__mod__, (sys.maxunicode+1,))
|
||||
self.assertRaises(OverflowError, u"%c".__mod__, (sys.maxunicode+1,))
|
||||
|
||||
# formatting jobs delegated from the string implementation:
|
||||
self.assertEqual('...%(foo)s...' % {'foo':u"abc"}, u'...abc...')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue