We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68632c5 commit 6d29cc9Copy full SHA for 6d29cc9
1 file changed
pymysqlreplication/packet.py
@@ -343,15 +343,15 @@ def read_int64(self) -> int:
343
def unpack_uint16(self, n: bytes) -> int:
344
return struct.unpack('<H', n[0:2])[0]
345
346
- def unpack_int24(self, n: bytes) -> Optional[str, Tuple[str, int]]:
+ def unpack_int24(self, n: bytes) -> Optional[Union[int, Tuple[str, int]]]:
347
try:
348
return struct.unpack('B', n[0])[0] \
349
+ (struct.unpack('B', n[1])[0] << 8) \
350
+ (struct.unpack('B', n[2])[0] << 16)
351
except TypeError:
352
return n[0] + (n[1] << 8) + (n[2] << 16)
353
354
- def unpack_int32(self, n: bytes) -> Optional[str, Tuple[str, int]]:
+ def unpack_int32(self, n: bytes) -> Optional[Union[int, Tuple[str, int]]]:
355
356
357
0 commit comments