summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-10 11:25:14 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-10 11:25:14 (GMT)
commiteb99e5157498ae37117a54cdb01fea082d842a0d (patch)
tree7e5311c2c7195db99e5098324671de8387ed0c42
parent5619ab926b83b3ce8ed8f24d52bcedc96835cb35 (diff)
parent19e9158497728e522f315777da1cd957a8736c20 (diff)
downloadcpython-eb99e5157498ae37117a54cdb01fea082d842a0d.zip
cpython-eb99e5157498ae37117a54cdb01fea082d842a0d.tar.gz
cpython-eb99e5157498ae37117a54cdb01fea082d842a0d.tar.bz2
Got rid of the array module dependency in the re module.
The re module could be used during building before array is built.
-rw-r--r--Lib/sre_compile.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 5ecd33a..f5aef7a 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -382,8 +382,7 @@ def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
def _bytes_to_codes(b):
# Convert block indices to word array
- import array
- a = array.array('I', b)
+ a = memoryview(b).cast('I')
assert a.itemsize == _sre.CODESIZE
assert len(a) * a.itemsize == len(b)
return a.tolist()