aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: