[Python-checkins] cpython: Remove now useless redefinition of chr/ord for narrow builds in

ezio.melotti python-checkins at python.org
Thu Sep 29 03:36:47 CEST 2011


http://hg.python.org/cpython/rev/90fef68f06e7
changeset:   72516:90fef68f06e7
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Thu Sep 29 04:36:38 2011 +0300
summary:
  Remove now useless redefinition of chr/ord for narrow builds in test_multibytecodec_support.py.

files:
  Lib/test/test_multibytecodec_support.py |  15 -------------
  1 files changed, 0 insertions(+), 15 deletions(-)


diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -264,21 +264,6 @@
 
                 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 = []

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list