Skip to content

Commit 3cbc23a

Browse files
gnpriceYhg1s
authored andcommitted
bpo-37758: Cut always-constant conditionals on sys.maxunicode. (GH-15302)
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.
1 parent 65366bc commit 3cbc23a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Lib/test/test_bigaddrspace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_repeat(self):
5555

5656
class StrTest(unittest.TestCase):
5757

58-
unicodesize = 2 if sys.maxunicode < 65536 else 4
58+
unicodesize = 4
5959

6060
@bigaddrspacetest
6161
def test_concat(self):

Tools/unicode/mkstringprep.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import re, sys
1+
import re
22
from unicodedata import ucd_3_2_0 as unicodedata
33

4-
if sys.maxunicode == 65535:
5-
raise RuntimeError("need UCS-4 Python")
6-
74
def gen_category(cats):
85
for i in range(0, 0x110000):
96
if unicodedata.category(chr(i)) in cats:

0 commit comments

Comments
 (0)