aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-01-01 17:30:06 +0200
committerMatti Picus <matti.picus@gmail.com>2019-01-01 17:30:06 +0200
commitae7118fba0c12a25ac42cc7c91344be1139beb28 (patch)
tree3c34caf6aa2d41a0b757c417b87e26645a2c1a4b
parenttypo (diff)
downloadpypy-ae7118fba0c12a25ac42cc7c91344be1139beb28.tar.gz
pypy-ae7118fba0c12a25ac42cc7c91344be1139beb28.tar.bz2
pypy-ae7118fba0c12a25ac42cc7c91344be1139beb28.zip
fix MAXUNICODE to 0x10ffff on this branch
-rw-r--r--TODO1
-rw-r--r--rpython/rlib/runicode.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/TODO b/TODO
index 3d732f6c03..cf71a2c86a 100644
--- a/TODO
+++ b/TODO
@@ -4,3 +4,4 @@
* improve performance of splitlines
* fix _pypyjson to not use a wrapped dict when decoding an object
* make sure we review all the places that call ord(unichr) to check for ValueErrors
+* Find a more elegant way to define MAXUNICODE in rpython/rlib/runicode.py
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
index cbbc86ea46..f38c865649 100644
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -8,7 +8,8 @@ from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rlib import jit, nonconst
-if rffi.sizeof(lltype.UniChar) == 4:
+# We always use MAXUNICODE = 0x10ffff when unicode objects use utf8
+if 1 or rffi.sizeof(lltype.UniChar) == 4:
MAXUNICODE = 0x10ffff
allow_surrogate_by_default = False
else: