diff options
author | Chris Johns <chrisj@rtems.org> | 2016-03-02 20:54:06 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2016-03-03 16:52:32 +1100 |
commit | 4001a74869c5e37443e20c3ff107f6ccf8e378f8 (patch) | |
tree | 486b1656d5bcd9d24edefd85f89accca6a587402 /tester/rt/console.py | |
parent | Fix ithe automake warning with newer perl versions. (diff) | |
download | rtems-tools-4001a74869c5e37443e20c3ff107f6ccf8e378f8.tar.bz2 |
Update rtems-tool to support Python 2 and 3.
Add solaris and netbsd.
Close #2619.
Diffstat (limited to 'tester/rt/console.py')
-rw-r--r-- | tester/rt/console.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tester/rt/console.py b/tester/rt/console.py index 74ec3bf..c473ad2 100644 --- a/tester/rt/console.py +++ b/tester/rt/console.py @@ -1,6 +1,6 @@ # # RTEMS Tools Project (http://www.rtems.org/) -# Copyright 2013-2014 Chris Johns (chrisj@rtems.org) +# Copyright 2013-2016 Chris Johns (chrisj@rtems.org) # All rights reserved. # # This file is part of the RTEMS Tools package in 'rtems-tools'. @@ -32,13 +32,15 @@ # RTEMS Testing Consoles # +from __future__ import print_function + import errno import fcntl import os import threading import time -import stty +from . import stty def save(): return stty.save() @@ -90,7 +92,7 @@ class tty(console): def __del__(self): super(tty, self).__del__() if self._tracing(): - print ':: tty close', self.dev + print(':: tty close', self.dev) fcntl.fcntl(me.tty.fd, fcntl.F_SETFL, fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) & ~os.O_NONBLOCK) self.close() @@ -98,7 +100,7 @@ class tty(console): def open(self): def _readthread(me, x): if self._tracing(): - print ':: tty runner started', self.dev + print(':: tty runner started', self.dev) fcntl.fcntl(me.tty.fd, fcntl.F_SETFL, fcntl.fcntl(me.tty.fd, fcntl.F_GETFL) | os.O_NONBLOCK) line = '' @@ -106,7 +108,7 @@ class tty(console): time.sleep(0.05) try: data = me.tty.fd.read() - except IOError, ioe: + except IOError as ioe: if ioe.errno == errno.EAGAIN: continue raise @@ -121,9 +123,9 @@ class tty(console): me.output(line) line = '' if self._tracing(): - print ':: tty runner finished', self.dev + print(':: tty runner finished', self.dev) if self._tracing(): - print ':: tty open', self.dev + print(':: tty open', self.dev) self.tty = stty.tty(self.dev) self.tty.set(self.setup) self.tty.on() |