[rtems-tools commit] tester: Simplify the console data handling
Chris Johns
chrisj at rtems.org
Sat Sep 18 22:30:08 UTC 2021
Module: rtems-tools
Branch: master
Commit: ad7b862cda6ee70f87a2a38c999fab5a59332169
Changeset: http://git.rtems.org/rtems-tools/commit/?id=ad7b862cda6ee70f87a2a38c999fab5a59332169
Author: Chris Johns <chrisj at rtems.org>
Date: Tue Sep 14 17:06:19 2021 +1000
tester: Simplify the console data handling
---
tester/rt/console.py | 11 ++++-------
1 file 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:
More information about the vc
mailing list