mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
Fix PyString_Format() so that '%c' % u'a' returns u'a'
instead of raising a TypeError. (From SF patch #710127) Add tests to verify this is fixed. Add various tests for '%c' % int.
This commit is contained in:
parent
2a04623ddd
commit
43440a621e
5 changed files with 18 additions and 0 deletions
|
@ -14,6 +14,10 @@ class StrTest(
|
|||
def fixtype(self, obj):
|
||||
return obj
|
||||
|
||||
def test_formatting(self):
|
||||
string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
|
||||
self.assertRaises(OverflowError, '%c'.__mod__, 0x1234)
|
||||
|
||||
def test_main():
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTest(unittest.makeSuite(StrTest))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue