]> granicus.if.org Git - python/commitdiff
bpo-37758: Cut always-constant conditionals on sys.maxunicode. (GH-15302)
authorGreg Price <gnprice@gmail.com>
Mon, 9 Sep 2019 15:20:40 +0000 (08:20 -0700)
committerT. Wouters <thomas@python.org>
Mon, 9 Sep 2019 15:20:40 +0000 (08:20 -0700)
Since PEP 393 in Python 3.3, this value is always 0x10ffff, the
maximum codepoint in Unicode; there's no longer such a thing as a
UCS-2 build of Python, which couldn't properly represent some
characters.

There are a couple of spots left where we still condition on the value
of this constant.  Take them out.

Lib/test/test_bigaddrspace.py
Tools/unicode/mkstringprep.py

index b639f68c2347bf72f0e7dff814e2d5b14843c2db..aa1f8ca75a98110b7b8adce36e05188513094fdc 100644 (file)
@@ -55,7 +55,7 @@ class BytesTest(unittest.TestCase):
 
 class StrTest(unittest.TestCase):
 
-    unicodesize = 2 if sys.maxunicode < 65536 else 4
+    unicodesize = 4
 
     @bigaddrspacetest
     def test_concat(self):
index ead020c3a7a4bbc75ffc96f3f23fe1d798d38d08..427188389a3b87cf485837c203f35a430e41d464 100644 (file)
@@ -1,9 +1,6 @@
-import re, sys
+import re
 from unicodedata import ucd_3_2_0 as unicodedata
 
-if sys.maxunicode == 65535:
-    raise RuntimeError("need UCS-4 Python")
-
 def gen_category(cats):
     for i in range(0, 0x110000):
         if unicodedata.category(chr(i)) in cats: