diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-03 13:32:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-03 13:32:53 +0200 |
commit | 647f46102873af704a84826620698ad4e9be127e (patch) | |
tree | 2ba263a72414679fc1b7a3f1704efdfe392ea530 /lib/runner.py | |
parent | ca4aa52f635ba46caf8927591ad13cd4bcbb1fc7 (diff) |
runner: handle all sorts of newline types
Diffstat (limited to 'lib/runner.py')
-rw-r--r-- | lib/runner.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/runner.py b/lib/runner.py index c9179c2..19b88f3 100644 --- a/lib/runner.py +++ b/lib/runner.py @@ -39,12 +39,7 @@ class SerialReader(serial.threaded.Protocol): str_data = data.decode('UTF-8') self.recv_buf += str_data - 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 = [] + lines = list(map(str.strip, self.recv_buf.split('\n'))) if len(lines) > 1: self.lines.extend(lines[:-1]) self.recv_buf = lines[-1] |