From ad7b862cda6ee70f87a2a38c999fab5a59332169 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 14 Sep 2021 17:06:19 +1000 Subject: tester: Simplify the console data handling --- tester/rt/console.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'tester') diff --git a/tester/rt/console.py b/tester/rt/console.py index 7e09bb9..13300da 100644 --- a/tester/rt/console.py +++ b/tester/rt/console.py @@ -109,7 +109,6 @@ class tty(console): data = me.tty.read() if isinstance(data, bytes): data = data.decode('utf-8', 'ignore') - data = [c for c in data if ord(c) < 128] except IOError as ioe: if ioe.errno == errno.EAGAIN: continue @@ -117,13 +116,11 @@ class tty(console): except: raise for c in data: - if len(c) == 0: - continue - if c != chr(0): + if ord(c) > 0 and ord(c) < 128: line += c - if c == '\n': - me.output(line) - line = '' + if c == '\n': + me.output(line) + line = '' if stty and path.exists(self.dev): self.tty = stty.tty(self.dev) else: -- cgit v1.2.3