Patch #442512: put block indices in the right byte order on bigendian systems.

This commit is contained in:
Martin v. Löwis 2001-07-19 14:26:10 +00:00
parent 123cbd286a
commit 3550dd30bb
1 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@
# See the sre.py file for information on usage and redistribution. # See the sre.py file for information on usage and redistribution.
# #
import _sre import _sre,sys
from sre_constants import * from sre_constants import *
@ -281,6 +281,9 @@ def _optimize_unicode(charset, fixup):
header = [block] header = [block]
assert MAXCODE == 65535 assert MAXCODE == 65535
for i in range(128): for i in range(128):
if sys.byteorder == 'big':
header.append(256*mapping[2*i]+mapping[2*i+1])
else:
header.append(mapping[2*i]+256*mapping[2*i+1]) header.append(mapping[2*i]+256*mapping[2*i+1])
data[0:0] = header data[0:0] = header
return [(BIGCHARSET, data)] return [(BIGCHARSET, data)]