1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

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 <finik@dishero.com>
This commit is contained in:
Dmitry Fink 2020-09-20 01:04:39 -07:00 committed by GitHub
parent 17ce398595
commit f015d4b03b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ class BleakDriver(object):
while not self._abort: while not self._abort:
if resp_queue.qsize() != 0: if resp_queue.qsize() != 0:
msg = resp_queue.get() msg = resp_queue.get()
self._handler(msg[0], msg[1]) self._handler(msg[0], bytes(msg[1]))
time.sleep(0.01) time.sleep(0.01)
logging.info("Processing thread has exited") logging.info("Processing thread has exited")