diff --git a/re-pcre/re.py b/re-pcre/re.py index f1408654..eb1dc075 100644 --- a/re-pcre/re.py +++ b/re-pcre/re.py @@ -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: