diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runner.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/runner.py b/lib/runner.py index fa08c01..9b95e6b 100644 --- a/lib/runner.py +++ b/lib/runner.py @@ -39,7 +39,12 @@ class SerialReader(serial.threaded.Protocol): str_data = data.decode('UTF-8') self.recv_buf += str_data - lines = self.recv_buf.split("\n\r") + if '\n\r' in self.recv_buf: + lines = self.recv_buf.split('\n\r') + elif '\r\n' in self.recv_buf: + lines = self.recv_buf.split('\r\n') + else: + lines = [] if len(lines) > 1: self.lines.extend(lines[:-1]) self.recv_buf = lines[-1] |