From ab58fe48eafb216b5b3c3ac5299bf255d778240e Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Wed, 15 Oct 2014 18:56:14 +0200 Subject: [PATCH] Workaround python 2.7.3 struct module bug when handling bytes() --- eSSP/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eSSP/__init__.py b/eSSP/__init__.py index d8b3b9f..0532ca8 100644 --- a/eSSP/__init__.py +++ b/eSSP/__init__.py @@ -50,7 +50,7 @@ class eSSP(object): def send_unpack(self, format_string, command, args=[], parse_status=True): resp = self.send(command, args, parse_status) - return struct.unpack(format_string, resp) + return struct.unpack(format_string, str(resp)) # py 2.7.3 struct workaround def read(self, parse_status=True): ''' Reads, parses and checks a single message from serial.