]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove now useless redefinition of chr/ord for narrow builds in test_multibytecodec_s...
authorEzio Melotti <ezio.melotti@gmail.com>
Thu, 29 Sep 2011 01:36:38 +0000 (04:36 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Thu, 29 Sep 2011 01:36:38 +0000 (04:36 +0300)
Lib/test/test_multibytecodec_support.py

index ef63b6934d588e5f11f887e3e60bb36ff0a42972..ac3b92b6ee729cbd420db38ffbdb3462e31ebd11 100644 (file)
@@ -264,21 +264,6 @@ class TestBase:
 
                 self.assertEqual(ostream.getvalue(), self.tstring[0])
 
-if len('\U00012345') == 2: # ucs2 build
-    _unichr = chr
-    def chr(v):
-        if v >= 0x10000:
-            return _unichr(0xd800 + ((v - 0x10000) >> 10)) + \
-                   _unichr(0xdc00 + ((v - 0x10000) & 0x3ff))
-        else:
-            return _unichr(v)
-    _ord = ord
-    def ord(c):
-        if len(c) == 2:
-            return 0x10000 + ((_ord(c[0]) - 0xd800) << 10) + \
-                          (ord(c[1]) - 0xdc00)
-        else:
-            return _ord(c)
 
 class TestBase_Mapping(unittest.TestCase):
     pass_enctest = []