diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-05-11 19:57:05 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-05-11 19:57:05 (GMT) |
commit | 1324c6f5e7ed0fb2d129b09fc27d3110e56e75c0 (patch) | |
tree | 7c5d36166c99f10400fa581d4b477e8d9c2fa12f | |
parent | b03ccc047278728d6d7173759bdbe83f22ecd9bc (diff) | |
download | cpython-1324c6f5e7ed0fb2d129b09fc27d3110e56e75c0.zip cpython-1324c6f5e7ed0fb2d129b09fc27d3110e56e75c0.tar.gz cpython-1324c6f5e7ed0fb2d129b09fc27d3110e56e75c0.tar.bz2 |
There's no longer a u prefix for unicode objects
=> drop it.
Fix idna test (encode() returns bytes now).
-rw-r--r-- | Lib/test/test_unicode.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 055f3a4..76674d5 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -55,9 +55,9 @@ class UnicodeTest( def test_literals(self): self.assertEqual('\xff', '\u00ff') self.assertEqual('\uffff', '\U0000ffff') - self.assertRaises(UnicodeError, eval, 'u\'\\Ufffffffe\'') - self.assertRaises(UnicodeError, eval, 'u\'\\Uffffffff\'') - self.assertRaises(UnicodeError, eval, 'u\'\\U%08x\'' % 0x110000) + self.assertRaises(UnicodeError, eval, '\'\\Ufffffffe\'') + self.assertRaises(UnicodeError, eval, '\'\\Uffffffff\'') + self.assertRaises(UnicodeError, eval, '\'\\U%08x\'' % 0x110000) def test_repr(self): if not sys.platform.startswith('java'): @@ -541,7 +541,7 @@ class UnicodeTest( def test_codecs_idna(self): # Test whether trailing dot is preserved - self.assertEqual("www.python.org.".encode("idna"), "www.python.org.") + self.assertEqual("www.python.org.".encode("idna"), b"www.python.org.") def test_codecs_errors(self): # Error handling (encoding) @@ -622,8 +622,8 @@ class UnicodeTest( # This excludes surrogates: in the full range, there would be # a surrogate pair (\udbff\udc00), which gets converted back # to a non-BMP character (\U0010fc00) - u = u''.join(map(chr, list(range(0,0xd800)) + - list(range(0xe000,0x10000)))) + u = ''.join(map(chr, list(range(0,0xd800)) + + list(range(0xe000,0x10000)))) for encoding in ('utf-8',): self.assertEqual(str(u.encode(encoding),encoding), u) |