mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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.
This commit is contained in:
parent
166746c142
commit
6b826abc70
3 changed files with 8 additions and 1 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue