aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-19 21:43:05 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-19 21:43:22 +0200
commit2f0530459ae5a2ae6b1c46a1083096d11d68cc83 (patch)
tree4c41772bdd295bdeb4c34af090d6c450a50bd94c
parentcc206740915cef4ac645024a416241dc0b5d2798 (diff)
downloadglutte-serial-web-2f0530459ae5a2ae6b1c46a1083096d11d68cc83.tar.gz
glutte-serial-web-2f0530459ae5a2ae6b1c46a1083096d11d68cc83.tar.bz2
glutte-serial-web-2f0530459ae5a2ae6b1c46a1083096d11d68cc83.zip
Fix some python3 issues
-rwxr-xr-xglutte_serial_web.py2
-rw-r--r--serialrx.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/glutte_serial_web.py b/glutte_serial_web.py
index f9ef067..a1a10ee 100755
--- a/glutte_serial_web.py
+++ b/glutte_serial_web.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# The MIT License (MIT)
#
diff --git a/serialrx.py b/serialrx.py
index b3bb7f5..5f62fea 100644
--- a/serialrx.py
+++ b/serialrx.py
@@ -123,8 +123,8 @@ class SerialRX(threading.Thread):
databyte = self.ser.read()
self.line_accumulator.append(databyte)
- if databyte == "\n":
- line = "".join(self.line_accumulator)
+ if databyte == b"\n":
+ line = b"".join(self.line_accumulator).decode()
self._parser.parse_message(line)
self.data_lock.acquire()
try:
@@ -166,7 +166,7 @@ class SerialRX(threading.Thread):
def unregister_client(self, queue):
self.data_lock.acquire()
try:
- self.clients = filter(lambda x: id(x) != id(queue), self.clients)
+ self.clients = [x for x in self.clients if id(x) != id(queue)]
except:
raise
finally: