From f015d4b03b6b5539e6dc7ca535c8838d162c5121 Mon Sep 17 00:00:00 2001 From: Dmitry Fink Date: Sun, 20 Sep 2020 01:04:39 -0700 Subject: [PATCH] Fix to work with Bleak on a mac (#78) Sometimes the data returnes is not byte/bytes, but native objective-c class _NSInlineData. Seems to be a bleak bug, just convert it to bytes as workaround for now. Co-authored-by: Dmitry Fink --- pylgbst/comms/cbleak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylgbst/comms/cbleak.py b/pylgbst/comms/cbleak.py index cb97c46..0924ea6 100644 --- a/pylgbst/comms/cbleak.py +++ b/pylgbst/comms/cbleak.py @@ -78,7 +78,7 @@ class BleakDriver(object): while not self._abort: if resp_queue.qsize() != 0: msg = resp_queue.get() - self._handler(msg[0], msg[1]) + self._handler(msg[0], bytes(msg[1])) time.sleep(0.01) logging.info("Processing thread has exited")