From 90122cf29a53a95c1f54556766a0f60f42d959f7 Mon Sep 17 00:00:00 2001 From: Jochen Hoenicke Date: Tue, 19 Jul 2016 21:37:54 +0200 Subject: [PATCH] Fix for older python version --- trezorlib/transport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trezorlib/transport.py b/trezorlib/transport.py index cdc6a52ab..8a788bb0c 100644 --- a/trezorlib/transport.py +++ b/trezorlib/transport.py @@ -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")