Skip to content

Commit

Permalink
Add 'byteorder' to int.from_bytes call for Python < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
bessman committed Sep 15, 2023
1 parent e82a2a6 commit 73c4a13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mcbootflash/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def get_response(interface: Serial) -> ResponseBase:
CommandCode.SELF_VERIFY: Response,
CommandCode.GET_MEMORY_ADDRESS_RANGE: MemoryRange,
}
packet_type = response_type_map[CommandCode(int.from_bytes(peek))]
packet_type = response_type_map[
CommandCode(int.from_bytes(peek, byteorder="little"))
]
remainder = interface.read(packet_type.get_size() - 1)
return packet_type.from_bytes(peek + remainder)

0 comments on commit 73c4a13

Please sign in to comment.