summaryrefslogtreecommitdiffstats
path: root/tester/rt/console.py
diff options
context:
space:
mode:
Diffstat (limited to 'tester/rt/console.py')
-rw-r--r--tester/rt/console.py16
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()