From cce51d8a961cb5b6af21cd44b357defc39e1b008 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 5 May 2019 12:26:24 +0200 Subject: Make code compatible with python3 with python2 support Warning: This is a preparation work for completly remove PyGTK. Because PyGTK is python2 only, most part of the code didn't work. But a last commands send to the headset is fonctional (This is why all this change). --- parrot_zik/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parrot_zik/message.py') diff --git a/parrot_zik/message.py b/parrot_zik/message.py index 214b6f9..822e057 100644 --- a/parrot_zik/message.py +++ b/parrot_zik/message.py @@ -11,14 +11,14 @@ class Message: def request(self): message = bytearray() message.extend(self.header) - message.extend(bytearray(self.request_string)) + message.extend(bytearray(self.request_string, 'utf-8')) return message @property def header(self): header = bytearray([0]) header.append(len(self.request_string) + 3) - header.append("\x80") + header.append(0x80) return header @property -- cgit v1.2.1