summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-03 16:22:09 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-03 16:22:09 (GMT)
commit6b826abc707eb101f8426382487de88cd4e7b046 (patch)
tree4f56a78f9a4108866b265a7acbd89ba5e3aa6994 /Lib/sre_compile.py
parent166746c142a88d4f27541f6102154cc592f208ee (diff)
downloadcpython-6b826abc707eb101f8426382487de88cd4e7b046.zip
cpython-6b826abc707eb101f8426382487de88cd4e7b046.tar.gz
cpython-6b826abc707eb101f8426382487de88cd4e7b046.tar.bz2
Creating an array with a bytes object as initializer
should treat the bytes as it treats a string. Not doing this broke re.compile() of big charsets.
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 6b28052..5b66084 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -353,6 +353,7 @@ def _optimize_unicode(charset, fixup):
# Convert byte array to word array
mapping = array.array(code, mapping)
assert mapping.itemsize == _sre.CODESIZE
+ assert len(mapping) * mapping.itemsize == 256
header = header + mapping.tolist()
data[0:0] = header
return [(BIGCHARSET, data)]