kopia lustrzana https://github.com/micropython/micropython-lib
re-pcre: Fix compatibility with big-endian systems.
rodzic
abddcd7893
commit
444004be32
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
import ffilib
|
||||
import array
|
||||
|
||||
|
@ -67,7 +68,7 @@ class PCREPattern:
|
|||
assert endpos == -1, "pos: %d, endpos: %d" % (pos, endpos)
|
||||
buf = bytes(4)
|
||||
pcre_fullinfo(self.obj, None, PCRE_INFO_CAPTURECOUNT, buf)
|
||||
cap_count = int.from_bytes(buf)
|
||||
cap_count = int.from_bytes(buf, sys.byteorder)
|
||||
ov = array.array('i', [0, 0, 0] * (cap_count + 1))
|
||||
num = pcre_exec(self.obj, None, s, len(s), pos, _flags, ov, len(ov))
|
||||
if num == -1:
|
||||
|
|
Ładowanie…
Reference in New Issue