1. David Jean Louis
  2. polib

Commits

David Jean Louis  committed d37ff83

Better way to test indianness

  • Participants
  • Parent commits 38dde78
  • Branches default

Comments (0)

Files changed (1)

File polib.py

View file
             voffsets += [l2, o2 + valuestart]
         offsets = koffsets + voffsets
         # check endianness for magic number
-        if struct.pack('@h', 1) == struct.pack('<h', 1):
+        if sys.byteorder == 'little':
             magic_number = MOFile.LITTLE_ENDIAN
         else:
             magic_number = MOFile.BIG_ENDIAN