diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-03-31 18:07:50 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-03-31 18:07:50 (GMT) |
commit | 43440a621e022fbeaff24f84dcf4d5458601fedc (patch) | |
tree | 4ffebf718b3a2fef2e38d3b441975b30dde80ea6 /Lib/test/test_str.py | |
parent | 2a04623ddd8c15a1d559440a5f4a63d43a3cafd7 (diff) | |
download | cpython-43440a621e022fbeaff24f84dcf4d5458601fedc.zip cpython-43440a621e022fbeaff24f84dcf4d5458601fedc.tar.gz cpython-43440a621e022fbeaff24f84dcf4d5458601fedc.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_str.py')
-rw-r--r-- | Lib/test/test_str.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py index 1b26106..b9f4845 100644 --- a/Lib/test/test_str.py +++ b/Lib/test/test_str.py @@ -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)) |