From 647f46102873af704a84826620698ad4e9be127e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 3 Apr 2019 13:32:53 +0200 Subject: runner: handle all sorts of newline types --- lib/runner.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') 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] -- cgit v1.2.3