We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4592499 commit 7f61ecbCopy full SHA for 7f61ecb
maxminddb/decoder.py
@@ -130,7 +130,7 @@ def decode(self, offset):
130
offset -- the location of the data structure to decode
131
"""
132
new_offset = offset + 1
133
- (ctrl_byte, ) = struct.unpack(b'!B', self._buffer[offset:new_offset])
+ ctrl_byte = int_from_byte(self._buffer[offset])
134
type_num = ctrl_byte >> 5
135
# Extended type
136
if not type_num:
@@ -147,7 +147,7 @@ def decode(self, offset):
147
return decoder(self, size, new_offset)
148
149
def _read_extended(self, offset):
150
- (next_byte, ) = struct.unpack(b'!B', self._buffer[offset:offset + 1])
+ next_byte = int_from_byte(self._buffer[offset])
151
type_num = next_byte + 7
152
if type_num < 7:
153
raise InvalidDatabaseError(
0 commit comments