Skip to content

Commit

Permalink
bpo-37758: Cut always-constant conditionals on sys.maxunicode. (GH-15302
Browse files Browse the repository at this point in the history
)

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.
  • Loading branch information
gnprice authored and Yhg1s committed Sep 9, 2019
1 parent 65366bc commit 3cbc23a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Lib/test/test_bigaddrspace.py
Expand Up @@ -55,7 +55,7 @@ def test_repeat(self):

class StrTest(unittest.TestCase):

unicodesize = 2 if sys.maxunicode < 65536 else 4
unicodesize = 4

@bigaddrspacetest
def test_concat(self):
Expand Down
5 changes: 1 addition & 4 deletions Tools/unicode/mkstringprep.py
@@ -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:
Expand Down

0 comments on commit 3cbc23a

Please sign in to comment.