mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-27 01:48:17 +00:00
Merge pull request #65 from jhoenicke/master
Fix for older python version
This commit is contained in:
commit
8bb7f550ad
@ -145,7 +145,7 @@ class TransportV1(Transport):
|
||||
|
||||
try:
|
||||
headerlen = struct.calcsize(">HL")
|
||||
(msg_type, datalen) = struct.unpack(">HL", chunk[3:3 + headerlen])
|
||||
(msg_type, datalen) = struct.unpack(">HL", bytes(chunk[3:3 + headerlen]))
|
||||
except:
|
||||
raise Exception("Cannot parse header")
|
||||
|
||||
@ -205,7 +205,7 @@ class TransportV2(Transport):
|
||||
|
||||
try:
|
||||
headerlen = struct.calcsize(">LLL")
|
||||
(session_id, msg_type, datalen) = struct.unpack(">LLL", chunk[2:2 + headerlen])
|
||||
(session_id, msg_type, datalen) = struct.unpack(">LLL", bytes(chunk[2:2 + headerlen]))
|
||||
except:
|
||||
raise Exception("Cannot parse header")
|
||||
|
||||
@ -218,7 +218,7 @@ class TransportV2(Transport):
|
||||
|
||||
try:
|
||||
headerlen = struct.calcsize(">L")
|
||||
(session_id,) = struct.unpack(">L", chunk[1:1 + headerlen])
|
||||
(session_id,) = struct.unpack(">L", bytes(chunk[1:1 + headerlen]))
|
||||
except:
|
||||
raise Exception("Cannot parse header")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user