summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-09-26 16:39:20 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-09-26 16:39:20 (GMT)
commit67c4cb1f13e0a8dbbe8d2447165f27b2ef8e48fd (patch)
treee24b998a044fcace9f4f9b9d640cda81f6afbde3 /Lib/sre_compile.py
parenteb42b026dbfd8583279e685f693b0483e06e5d29 (diff)
downloadcpython-67c4cb1f13e0a8dbbe8d2447165f27b2ef8e48fd.zip
cpython-67c4cb1f13e0a8dbbe8d2447165f27b2ef8e48fd.tar.gz
cpython-67c4cb1f13e0a8dbbe8d2447165f27b2ef8e48fd.tar.bz2
Disable big charsets in UCS-4 builds. Works around #599377.
Will backport to 2.2
Diffstat (limited to 'Lib/sre_compile.py')
-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