summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/sre_compile.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 30957a8..e5adb7e 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -188,6 +188,9 @@ def _optimize_charset(charset, fixup):
# XXX: could append to charmap tail
return charset # cannot compress
except IndexError:
+ if sys.maxunicode != 65535:
+ # XXX: big charsets don't work in UCS-4 builds
+ return charset
# character set contains unicode characters
return _optimize_unicode(charset, fixup)
# compress character map