import sys
+import array
PY2 = sys.version_info[0] == 2
cmp = lambda a, b: (a > b) - (a < b)
+ array_tobytes = array.array.tobytes
+
else:
text_type = unicode
string_types = (str, unicode)
cmp = cmp
+ array_tobytes = array.array.tostring
+
number_types = integer_types + (float,)
import struct
from babel.messages.catalog import Catalog, Message
-from babel._compat import range_type
+from babel._compat import range_type, array_tobytes
LE_MAGIC = 0x950412de
7 * 4, # start of key index
7 * 4 + len(messages) * 8, # start of value index
0, 0 # size and offset of hash table
- ) + array.array("i", offsets).tostring() + ids + strs)
+ ) + array_tobytes(array.array("i", offsets)) + ids + strs)