summaryrefslogtreecommitdiffstats
path: root/tester
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2021-09-14 17:06:19 +1000
committerChris Johns <chrisj@rtems.org>2021-09-19 08:31:58 +1000
commitad7b862cda6ee70f87a2a38c999fab5a59332169 (patch)
tree40dbab1dab8c67071ca58df67c5bab4dea43b3ef /tester
parentcheck.py: Fix incorrect use of os.linesep (diff)
downloadrtems-tools-ad7b862cda6ee70f87a2a38c999fab5a59332169.tar.bz2
tester: Simplify the console data handling
Diffstat (limited to 'tester')
-rw-r--r--tester/rt/console.py11
1 files changed, 4 insertions, 7 deletions
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: