mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Got rid of the array module dependency in the re module.
The re module could be used during building before array is built.
This commit is contained in:
parent
0c938f6d24
commit
19e9158497
1 changed files with 1 additions and 2 deletions
|
@ -410,8 +410,7 @@ def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
|
||||||
|
|
||||||
def _bytes_to_codes(b):
|
def _bytes_to_codes(b):
|
||||||
# Convert block indices to word array
|
# Convert block indices to word array
|
||||||
import array
|
a = memoryview(b).cast('I')
|
||||||
a = array.array('I', b)
|
|
||||||
assert a.itemsize == _sre.CODESIZE
|
assert a.itemsize == _sre.CODESIZE
|
||||||
assert len(a) * a.itemsize == len(b)
|
assert len(a) * a.itemsize == len(b)
|
||||||
return a.tolist()
|
return a.tolist()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue