Index: rtemstoolkit/check.py
===================================================================
--- rtemstoolkit/check.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/check.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -156,14 +156,14 @@
         log.notice('RTEMS Source Builder - Check, v%s' % (version.str()))
         if host_setup(_opts):
-            print 'Environment is ok'
+            print('Environment is ok')
         else:
-            print 'Environment is not correctly set up'
-    except error.general, gerr:
-        print gerr
+            print('Environment is not correctly set up')
+    except error.general as gerr:
+        print(gerr)
         sys.exit(1)
-    except error.internal, ierr:
-        print ierr
+    except error.internal as ierr:
+        print (ierr)
         sys.exit(1)
-    except error.exit, eerr:
+    except error.exit:
         pass
     except KeyboardInterrupt:
Index: rtemstoolkit/config.py
===================================================================
--- rtemstoolkit/config.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/config.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -49,8 +49,8 @@
     import path
 except KeyboardInterrupt:
-    print 'user terminated'
+    print('user terminated')
     sys.exit(1)
 except:
-    print 'error: unknown application load error'
+    print('error: unknown application load error')
     sys.exit(1)
 
@@ -138,5 +138,5 @@
         trace_me = False
         if trace_me:
-            print '------------------------------------------------------'
+            print('------------------------------------------------------')
         macros = []
         nesting = []
@@ -145,5 +145,5 @@
         while c < len(s):
             if trace_me:
-                print 'ms:', c, '"' + s[c:] + '"', has_braces, len(nesting), nesting
+                print('ms:', c, '"' + s[c:] + '"', has_braces, len(nesting), nesting)
             #
             # We need to watch for shell type variables or the form '${var}' because
@@ -193,7 +193,7 @@
             c += 1
         if trace_me:
-            print 'ms:', macros
+            print('ms:', macros)
         if trace_me:
-            print '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
+            print('-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
         return macros
 
@@ -751,5 +751,5 @@
             log.trace('config: %s: _open: %s' % (self.init_name, path.host(configname)))
             config = open(path.host(configname), 'r')
-        except IOError, err:
+        except IOError as err:
             raise error.general('error opening config file: %s' % (path.host(configname)))
         self.configpath += [configname]
@@ -841,11 +841,11 @@
         for config_file in opts.config_files():
             s = file(config_file, opts)
-            print s
+            print(s)
             del s
-    except error.general, gerr:
-        print gerr
+    except error.general as gerr:
+        print(gerr)
         sys.exit(1)
-    except error.internal, ierr:
-        print ierr
+    except error.internal as ierr:
+        print(ierr)
         sys.exit(1)
     except KeyboardInterrupt:
Index: rtemstoolkit/error.py
===================================================================
--- rtemstoolkit/error.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/error.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -58,8 +58,8 @@
     try:
         raise general('a general error')
-    except general, gerr:
-        print 'caught:', gerr
+    except general as gerr:
+        print('caught:', gerr)
     try:
         raise internal('an internal error')
-    except internal, ierr:
-        print 'caught:', ierr
+    except internal as ierr:
+        print('caught:', ierr)
Index: rtemstoolkit/execute.py
===================================================================
--- rtemstoolkit/execute.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/execute.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -128,5 +128,5 @@
             is a timeout check."""
             if trace_threads:
-                print 'executte:_writethread: start'
+                print('executte:_writethread: start')
             try:
                 while True:
@@ -143,5 +143,5 @@
             except:
                 if trace_threads:
-                    print 'executte:_writethread: exception'
+                    print('executte:_writethread: exception')
                 pass
             try:
@@ -150,5 +150,5 @@
                 pass
             if trace_threads:
-                print 'executte:_writethread: finished'
+                print('executte:_writethread: finished')
 
         def _readthread(exe, fh, out, prefix = ''):
@@ -168,5 +168,5 @@
 
             if trace_threads:
-                print 'executte:_readthread: start'
+                print('executte:_readthread: start')
             count = 0
             line = ''
@@ -188,5 +188,5 @@
                 raise
                 if trace_threads:
-                    print 'executte:_readthread: exception'
+                    print('executte:_readthread: exception')
                 pass
             try:
@@ -197,5 +197,5 @@
                 _output_line(line, exe, prefix, out, 100)
             if trace_threads:
-                print 'executte:_readthread: finished'
+                print('executte:_readthread: finished')
 
         def _timerthread(exe, interval, function):
@@ -346,5 +346,5 @@
             if self.verbose:
                 log.output('exit: ' + str(exit_code))
-        except OSError, ose:
+        except OSError as ose:
             exit_code = ose.errno
             if self.verbose:
@@ -454,5 +454,5 @@
         try:
             if self.proc is not None:
-                print "sending sig"
+                print("sending sig")
                 self.proc.send_signal(signal)
         except:
@@ -518,6 +518,6 @@
                              capture = False, stdin = subprocess.PIPE)
         if ec == 0:
-            print 'piping input into ' + commands['pipe'][0] + ': ' + \
-                  commands['pipe'][2]
+            print('piping input into ' + commands['pipe'][0] + ': ' + \
+                  commands['pipe'][2])
             proc.stdin.write(commands['pipe'][2])
             proc.stdin.close()
@@ -545,8 +545,8 @@
     commands['unix']['pipe'] = ('grep', 'hello', 'hello world')
 
-    print arg_list('cmd a1 a2 "a3 is a string" a4')
-    print arg_list('cmd b1 b2 "b3 is a string a4')
-    print arg_subst(['nothing', 'xx-%0-yyy', '%1', '%2-something'],
-                    ['subst0', 'subst1', 'subst2'])
+    print(arg_list('cmd a1 a2 "a3 is a string" a4'))
+    print(arg_list('cmd b1 b2 "b3 is a string a4'))
+    print(arg_subst(['nothing', 'xx-%0-yyy', '%1', '%2-something'],
+                    ['subst0', 'subst1', 'subst2']))
 
     e = execute(error_prefix = 'ERR: ', verbose = True)
Index: rtemstoolkit/git.py
===================================================================
--- rtemstoolkit/git.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/git.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -193,9 +193,9 @@
     opts = options.load(sys.argv)
     g = repo('.', opts)
-    print g.git_version()
-    print g.valid()
-    print g.status()
-    print g.clean()
-    print g.remotes()
-    print g.email()
-    print g.head()
+    print(g.git_version())
+    print(g.valid())
+    print(g.status())
+    print(g.clean())
+    print(g.remotes())
+    print(g.email())
+    print(g.head())
Index: rtemstoolkit/log.py
===================================================================
--- rtemstoolkit/log.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/log.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -75,5 +75,5 @@
         lock.acquire()
         for l in text.replace(chr(13), '').splitlines():
-            print l
+            print(l)
         lock.release()
 
@@ -93,5 +93,5 @@
         lock.acquire()
         for l in text.replace(chr(13), '').splitlines():
-            print l
+            print(l)
         lock.release()
     if not stdout_only:
@@ -128,5 +128,5 @@
                     try:
                         self.fhs.append(file(s, 'w'))
-                    except IOError, ioe:
+                    except IOError as ioe:
                          raise error.general("creating log file '" + s + \
                                              "': " + str(ioe))
@@ -187,40 +187,40 @@
     l.output('log: hello world NONE')
     l.flush()
-    print '=-' * 40
-    print 'tail: %d' % (len(l.tail))
-    print l
-    print '=-' * 40
+    print('=-' * 40)
+    print('tail: %d' % (len(l.tail)))
+    print(l)
+    print('=-' * 40)
     for i in range(0, 10):
         l.output('log: hello world 2: %d\n' % (i))
     l.flush()
-    print '=-' * 40
-    print 'tail: %d' % (len(l.tail))
-    print l
-    print '=-' * 40
+    print('=-' * 40)
+    print('tail: %d' % (len(l.tail)))
+    print(l)
+    print('=-' * 40)
     for i in [0, 1]:
         quiet = False
         tracing = False
-        print '- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30)
+        print('- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30))
         trace('trace with quiet and trace off')
         notice('notice with quiet and trace off')
         quiet = True
         tracing = False
-        print '- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30)
+        print('- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30))
         trace('trace with quiet on and trace off')
         notice('notice with quiet on and trace off')
         quiet = False
         tracing = True
-        print '- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30)
+        print('- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30))
         trace('trace with quiet off and trace on')
         notice('notice with quiet off and trace on')
         quiet = True
         tracing = True
-        print '- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30)
+        print('- quiet:%s - trace:%s %s' % (str(quiet), str(tracing), '-' * 30))
         trace('trace with quiet on and trace on')
         notice('notice with quiet on and trace on')
         default = l
-    print '=-' * 40
-    print 'tail: %d' % (len(l.tail))
-    print l
-    print '=-' * 40
+    print('=-' * 40)
+    print('tail: %d' % (len(l.tail)))
+    print(l)
+    print('=-' * 40)
     del l
Index: rtemstoolkit/macros.py
===================================================================
--- rtemstoolkit/macros.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/macros.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -240,5 +240,5 @@
         trace_me = False
         if trace_me:
-            print '[[[[]]]] parsing macros'
+            print('[[[[]]]] parsing macros')
         orig_macros = copy.copy(self.macros)
         map = 'global'
@@ -255,6 +255,6 @@
             for c in l:
                 if trace_me:
-                    print ']]]]]]]] c:%s(%d) s:%s t:"%s" m:%r M:%s' % \
-                        (c, ord(c), state, token, macro, map)
+                    print(']]]]]]]] c:%s(%d) s:%s t:"%s" m:%r M:%s' % \
+                        (c, ord(c), state, token, macro, map))
                 l_remaining = l_remaining[1:]
                 if c is '#' and not state.startswith('value'):
@@ -379,5 +379,5 @@
                     self.files += [n]
                     return
-                except IOError, err:
+                except IOError as err:
                     pass
         raise error.general('opening macro file: %s' % \
@@ -491,22 +491,22 @@
     import copy
     import sys
-    print inspect.getfile(macros)
+    print(inspect.getfile(macros))
     m = macros(name = 'defaults.mc')
     d = copy.copy(m)
     m['test1'] = 'something'
     if d.has_key('test1'):
-        print 'error: copy failed.'
+        print('error: copy failed.')
         sys.exit(1)
     m.parse("[test]\n" \
             "test1: none, undefine, ''\n" \
             "name:  none, override, 'pink'\n")
-    print 'set test:', m.set_read_map('test')
+    print('set test:', m.set_read_map('test'))
     if m['name'] != 'pink':
-        print 'error: override failed. name is %s' % (m['name'])
+        print('error: override failed. name is %s' % (m['name']))
         sys.exit(1)
     if m.has_key('test1'):
-        print 'error: map undefine failed.'
+        print('error: map undefine failed.')
         sys.exit(1)
-    print 'unset test:', m.unset_read_map('test')
-    print m
-    print m.keys()
+    print('unset test:', m.unset_read_map('test'))
+    print(m)
+    print(m.keys())
Index: rtemstoolkit/mailer.py
===================================================================
--- rtemstoolkit/mailer.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/mailer.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -76,5 +76,5 @@
                 lines = mrc.readlines()
                 mrc.close()
-            except IOError, err:
+            except IOError as err:
                 raise error.general('error reading: %s' % (mailrc))
             for l in lines:
@@ -105,7 +105,7 @@
             s = smtplib.SMTP(self.smtp_host())
             s.sendmail(from_addr, [to_addr], msg)
-        except smtplib.SMTPException, se:
+        except smtplib.SMTPException as se:
             raise error.general('sending mail: %s' % (str(se)))
-        except socket.error, se:
+        except socket.error as se:
             raise error.general('sending mail: %s' % (str(se)))
 
@@ -116,5 +116,5 @@
     opts = options.load(sys.argv, optargs = optargs, defaults = 'defaults.mc')
     m = mail(opts)
-    print 'From: %s' % (m.from_address())
-    print 'SMTP Host: %s' % (m.smtp_host())
+    print('From: %s' % (m.from_address()))
+    print('SMTP Host: %s' % (m.smtp_host()))
     m.send(m.from_address(), 'Test mailer.py', 'This is a test')
Index: rtemstoolkit/options.py
===================================================================
--- rtemstoolkit/options.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/options.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -274,7 +274,7 @@
 
     def help(self):
-        print '%s: [options] [args]' % (self.command_name)
-        print 'RTEMS Tools Project (c) 2012-2015 Chris Johns'
-        print 'Options and arguments:'
+        print('%s: [options] [args]' % (self.command_name))
+        print('RTEMS Tools Project (c) 2012-2015 Chris Johns')
+        print('Options and arguments:')
         opts = self.long_opts_help.keys()
         if self.optargs:
@@ -288,5 +288,5 @@
             else:
                 raise error.general('invalid help data: %s' %(o))
-            print '%-*s : %s' % (indent, o, h)
+            print('%-*s : %s' % (indent, o, h))
         raise error.exit()
 
@@ -581,11 +581,11 @@
         log.notice('Defaults:')
         log.notice(str(opts.defaults))
-    except error.general, gerr:
-        print gerr
+    except error.general as gerr:
+        print(gerr)
         sys.exit(1)
-    except error.internal, ierr:
-        print ierr
+    except error.internal as ierr:
+        print(ierr)
         sys.exit(1)
-    except error.exit, eerr:
+    except error.exit:
         pass
     except KeyboardInterrupt:
Index: rtemstoolkit/path.py
===================================================================
--- rtemstoolkit/path.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/path.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -123,16 +123,16 @@
             try:
                 os.makedirs(host(path))
-            except IOError, err:
-                raise error.general('cannot make directory: %s' % (path))
-            except OSError, err:
-                raise error.general('cannot make directory: %s' % (path))
-            except WindowsError, err:
+            except IOError:
+                raise error.general('cannot make directory: %s' % (path))
+            except OSError:
+                raise error.general('cannot make directory: %s' % (path))
+            except WindowsError:
                 raise error.general('cannot make directory: %s' % (path))
         else:
             try:
                 os.makedirs(host(path))
-            except IOError, err:
-                raise error.general('cannot make directory: %s' % (path))
-            except OSError, err:
+            except IOError:
+                raise error.general('cannot make directory: %s' % (path))
+            except OSError:
                 raise error.general('cannot make directory: %s' % (path))
 
@@ -140,5 +140,5 @@
 
     def _onerror(function, path, excinfo):
-        print 'removeall error: (%s) %s' % (excinfo, path)
+        print('removeall error: (%s) %s' % (excinfo, path))
 
     path = host(path)
@@ -209,11 +209,11 @@
             else:
                 shutil.copy2(srcname, dstname)
-        except shutil.Error, err:
+        except shutil.Error as err:
             raise error.general('copying tree: %s -> %s: %s' % (src, dst, str(err)))
-        except EnvironmentError, why:
+        except EnvironmentError as why:
             raise error.general('copying tree: %s -> %s: %s' % (srcname, dstname, str(why)))
     try:
         shutil.copystat(src, dst)
-    except OSError, why:
+    except OSError as why:
         ok = False
         if windows:
@@ -224,16 +224,16 @@
 
 if __name__ == '__main__':
-    print host('/a/b/c/d-e-f')
-    print host('//a/b//c/d-e-f')
-    print shell('/w/x/y/z')
-    print basename('/as/sd/df/fg/me.txt')
-    print dirname('/as/sd/df/fg/me.txt')
-    print join('/d', 'g', '/tyty/fgfg')
+    print(host('/a/b/c/d-e-f'))
+    print(host('//a/b//c/d-e-f'))
+    print(shell('/w/x/y/z'))
+    print(basename('/as/sd/df/fg/me.txt'))
+    print(dirname('/as/sd/df/fg/me.txt'))
+    print(join('/d', 'g', '/tyty/fgfg'))
     windows = True
-    print host('/a/b/c/d-e-f')
-    print host('//a/b//c/d-e-f')
-    print shell('/w/x/y/z')
-    print shell('w:/x/y/z')
-    print basename('x:/sd/df/fg/me.txt')
-    print dirname('x:/sd/df/fg/me.txt')
-    print join('s:/d/', '/g', '/tyty/fgfg')
+    print(host('/a/b/c/d-e-f'))
+    print(host('//a/b//c/d-e-f'))
+    print(shell('/w/x/y/z'))
+    print(shell('w:/x/y/z'))
+    print(basename('x:/sd/df/fg/me.txt'))
+    print(dirname('x:/sd/df/fg/me.txt'))
+    print(join('s:/d/', '/g', '/tyty/fgfg'))
Index: rtemstoolkit/version.py
===================================================================
--- rtemstoolkit/version.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ rtemstoolkit/version.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -43,6 +43,6 @@
 
 if __name__ == '__main__':
-    print 'major = %d' % (major)
-    print 'minor = %d' % (minor)
-    print 'revision = %d' % (revision)
-    print 'Version: %s' % (str())
+    print('major = %d' % (major))
+    print('minor = %d' % (minor))
+    print('revision = %d' % (revision))
+    print('Version: %s' % (str()))
Index: tester/rt/config.py
===================================================================
--- tester/rt/config.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/config.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -186,5 +186,5 @@
         if self.realtime_trace:
             for l in text:
-                print ' '.join(l)
+                print(' '.join(l))
 
     def run(self):
Index: tester/rt/console.py
===================================================================
--- tester/rt/console.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/console.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -101,5 +101,5 @@
         super(tty, self).__del__()
         if self._tracing():
-            print ':: tty close', self.dev
+            print(':: tty close', self.dev)
         if fcntl is not None:
             fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
@@ -110,5 +110,5 @@
         def _readthread(me, x):
             if self._tracing():
-                print ':: tty runner started', self.dev
+                print(':: tty runner started', self.dev)
             if fcntl is not None:
                 fcntl.fcntl(me.tty.fd, fcntl.F_SETFL,
@@ -119,5 +119,5 @@
                 try:
                     data = me.tty.fd.read()
-                except IOError, ioe:
+                except IOError as ioe:
                     if ioe.errno == errno.EAGAIN:
                         continue
@@ -134,7 +134,7 @@
                         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)
Index: tester/rt/gdb.py
===================================================================
--- tester/rt/gdb.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/gdb.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -77,10 +77,10 @@
     def _lock(self, msg):
         if self.lock_trace:
-            print '|[   LOCK:%s ]|' % (msg)
+            print('|[   LOCK:%s ]|' % (msg))
         self.lock.acquire()
 
     def _unlock(self, msg):
         if self.lock_trace:
-            print '|] UNLOCK:%s [|' % (msg)
+            print('|] UNLOCK:%s [|' % (msg))
         self.lock.release()
 
@@ -93,5 +93,5 @@
     def _put(self, text):
         if self.trace:
-            print ')))', text
+            print(')))', text)
         self.commands.put(text)
 
@@ -101,9 +101,9 @@
         try:
             if self.trace:
-                print '... input empty ', self.input.empty()
+                print('... input empty ', self.input.empty())
             if self.input.empty():
                 line = self.commands.get(block = False)
                 if self.trace:
-                    print '+++', line
+                    print('+++', line)
                 self.input.put(line)
         except:
@@ -114,10 +114,10 @@
         self._lock('_reader')
         if self.trace:
-            print '<<<', line
+            print('<<<', line)
         try:
             self.lc += 1
             if line.startswith('(gdb)'):
                 if self.trace:
-                    print '^^^ (gdb)'
+                    print('^^^ (gdb)')
                 if not self._input_commands():
                     self.gdb_expect()
@@ -139,5 +139,5 @@
                 line = self.input.get(timeout = 0.5)
                 if self.trace:
-                    print '>>> input: queue=%d' % (self.input.qsize()), line
+                    print('>>> input: queue=%d' % (self.input.qsize()), line)
             except Queue.Empty:
                 return True
@@ -147,8 +147,8 @@
         except:
             if self.trace:
-                print 'writer exception'
+                print('writer exception')
             pass
         if self.trace:
-            print 'writer closing'
+            print('writer closing')
         return False
 
@@ -207,5 +207,5 @@
             ec, proc = self.process.open(cmds, timeout = (timeout, self._timeout))
             if self.trace:
-                print 'gdb done', ec
+                print('gdb done', ec)
             if ec > 0:
                 raise error.general('gdb exec: %s: %s' % (cmds[0], os.strerror(ec)))
@@ -220,5 +220,5 @@
     def gdb_expect(self):
         if self.trace:
-            print '}}} gdb-expect'
+            print('}}} gdb-expect')
         if self.process and not self.running and self.script is not None:
             if self.script_line == len(self.script):
@@ -239,10 +239,10 @@
             try:
                 if self.mi_trace:
-                    print 'mi-data:', lines
+                    print('mi-data:', lines)
                 rec = pygdb.mi_parser.process(lines)
             finally:
                 self._mi_unlock()
             if self.mi_trace:
-                print 'mi-rec:', rec
+                print('mi-rec:', rec)
             if rec.record_type == 'result':
                 if rec.type == 'result':
@@ -256,10 +256,10 @@
                     if rec.class_ == 'running':
                         if self.trace:
-                            print '*** running'
+                            print('*** running')
                         self._put('')
                         self.running = True
                     elif rec.class_ == 'stopped':
                         if self.trace:
-                            print '*** stopped'
+                            print('*** stopped')
                         self.running = False
                         #self._put('-data-list-register-values')
@@ -284,5 +284,5 @@
                         lines = self.output_buffer[:last_lf]
                         if self.trace:
-                            print '/// console output'
+                            print('/// console output')
                         for line in lines.splitlines():
                             self.output(line)
@@ -290,5 +290,5 @@
         except:
             if self.trace:
-                print '/// console output'
+                print('/// console output')
             for line in lines.splitlines():
                 self.output(line)
@@ -298,7 +298,7 @@
     try:
         def output(text):
-            print ']', text
+            print(']', text)
         def gdb_console(text):
-            print '>', text
+            print('>', text)
         script = ['target sim']
         if len(sys.argv) > 1:
Index: tester/rt/options.py
===================================================================
--- tester/rt/options.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/options.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -115,11 +115,11 @@
         log.notice('Defaults:')
         log.notice(str(_opts.defaults))
-    except error.general, gerr:
-        print gerr
+    except error.general as gerr:
+        print(gerr)
         sys.exit(1)
-    except error.internal, ierr:
-        print ierr
+    except error.internal as ierr:
+        print(ierr)
         sys.exit(1)
-    except error.exit, eerr:
+    except error.exit:
         pass
     except KeyboardInterrupt:
Index: tester/rt/pygdb/mi_parser.py
===================================================================
--- tester/rt/pygdb/mi_parser.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/pygdb/mi_parser.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -94,5 +94,5 @@
 		def t_default(self, s):
 			r'( . | \n )+'
-			raise Exception, "Specification error: unmatched input for '%s'" % s
+			raise Exception("Specification error: unmatched input for '%s'" % s)
 
 		def __unescape(self, s):
@@ -168,6 +168,6 @@
 		def error(self, token, i=0, tokens=None):
 			if i > 2:
-				print '%s %s %s %s' % (tokens[i-3], tokens[i-2], tokens[i-1], tokens[i])
-			raise Exception, "Syntax error at or near %d:'%s' token" % (i, token)
+				print('%s %s %s %s' % (tokens[i-3], tokens[i-2], tokens[i-1], tokens[i]))
+			raise Exception("Syntax error at or near %d:'%s' token" % (i, token))
 
 	class GdbMiInterpreter(spark.GenericASTTraversal):
@@ -191,5 +191,5 @@
 			# result ::= variable = value
 			node.value = { node[0].value: node[2].value }
-			#print 'result: %s' % node.value
+			#print('result: %s' % node.value)
 
 		def n_tuple(self, node):
@@ -206,5 +206,5 @@
 					for n, v in result.items():
 						if node.value.has_key(n):
-							#print '**********list conversion: [%s] %s -> %s' % (n, node.value[n], v)
+							#print('**********list conversion: [%s] %s -> %s' % (n, node.value[n], v))
 							old = node.value[n]
 							if not isinstance(old, list):
@@ -214,6 +214,6 @@
 							node.value[n] = v
 			else:
-				raise Exception, 'Invalid tuple'
-			#print 'tuple: %s' % node.value
+				raise Exception('Invalid tuple')
+			#print('tuple: %s' % node.value)
 
 		def n_list(self, node):
@@ -231,5 +231,5 @@
 				#list ::= { value }
 				#list ::= { value value_list }
-			#print 'list %s' % node.value
+			#print('list %s' % node.value)
 
 		def n_value_list(self, node):
@@ -248,5 +248,5 @@
 				# result_list ::= , result result_list
 				node.value = [ node[1].value ] + node[2].value
-			#print 'result_list: %s' % node.value
+			#print('result_list: %s' % node.value)
 
 		def n_result_record(self, node):
@@ -258,5 +258,5 @@
 				# result_record ::= result_header nl
 				pass
-			#print 'result_record: %s' % (node.value)
+			#print('result_record: %s' % (node.value))
 
 		def n_result_header(self, node):
@@ -285,5 +285,5 @@
 				'record_type': 'stream'
 			}
-			#print 'stream_record: %s' % node.value
+			#print('stream_record: %s' % node.value)
 
 		def n_record_list(self, node):
@@ -294,8 +294,8 @@
 				# record_list ::= generic_record record_list
 				node.value = [ node[0].value ] + node[1].value
-			#print 'record_list: %s' % node.value
+			#print('record_list: %s' % node.value)
 
 		#def default(self, node):
-			#print 'default: ' + node.type
+			#print('default: ' + node.type)
 
 	class GdbDynamicObject:
@@ -364,5 +364,5 @@
 def process(input):
 	tokens = scan(input)
-        ast = parse(tokens)
+	ast = parse(tokens)
 	__the_interpreter(ast)
 	return __the_output(ast.value)
@@ -374,7 +374,7 @@
 			for token in tokens:
 				if token.value:
-					print token.type + ': ' + token.value
+					print(token.type + ': ' + token.value)
 				else:
-					print token.type
+					print(token.type)
 
 		def run_test(test):
@@ -387,5 +387,5 @@
 				__the_interpreter(ast)
 				output = __the_output(ast.value)
-				print output
+				print(output)
 
 		x = '"No symbol table is loaded.  Use the \\"file\\" command."'
Index: tester/rt/pygdb/spark.py
===================================================================
--- tester/rt/pygdb/spark.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/pygdb/spark.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -61,5 +61,5 @@
 
 	def error(self, s, pos):
-		print "Lexical error at position %s" % pos
+		print("Lexical error at position %s" % pos)
 		raise SystemExit
 
@@ -87,5 +87,5 @@
 	def t_default(self, s):
 		r'( . | \n )+'
-		print "Specification error: unmatched input"
+		print("Specification error: unmatched input")
 		raise SystemExit
 
@@ -304,5 +304,5 @@
 
 	def error(self, token):
-		print "Syntax error at or near `%s' token" % token
+		print("Syntax error at or near `%s' token" % token)
 		raise SystemExit
 
@@ -350,5 +350,6 @@
 		return self._NULLABLE == sym[0:len(self._NULLABLE)]
 
-	def skip(self, (lhs, rhs), pos=0):
+	def skip(self, lhs_rhs, pos=0):
+		lhs, rhs = lhs_rhs
 		n = len(rhs)
 		while pos < n:
@@ -613,5 +614,5 @@
 		else:
 			rule = self.newrules[nt][0]
-		#print rule
+		#print(rule)
 
 		rhs = rule[1]
@@ -632,5 +633,5 @@
 		if len(choices) > 1:
 			rule = self.ambiguity(choices)
-		#print rule
+		#print(rule)
 
 		rhs = rule[1]
@@ -669,5 +670,5 @@
 			name2index[name] = i
 		sortlist.sort()
-		list = map(lambda (a,b): b, sortlist)
+		list = list(map(lambda a,b: b, sortlist))
 		return rules[name2index[self.resolve(list)]]
 
@@ -834,14 +835,14 @@
 def _dump(tokens, sets, states):
 	for i in range(len(sets)):
-		print 'set', i
+		print('set', i)
 		for item in sets[i]:
-			print '\t', item
+			print('\t', item)
 			for (lhs, rhs), pos in states[item[0]].items:
-				print '\t\t', lhs, '::=',
-				print string.join(rhs[:pos]),
-				print '.',
-				print string.join(rhs[pos:])
+				print('\t\t', lhs, '::=',)
+				print(string.join(rhs[:pos]),)
+				print('.',)
+				print(string.join(rhs[pos:]))
 		if i < len(tokens):
 			print
-			print 'token', str(tokens[i])
+			print('token', str(tokens[i]))
 			print
Index: tester/rt/stty.py
===================================================================
--- tester/rt/stty.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/stty.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -73,5 +73,5 @@
         try:
             self.fd = open(dev, 'rw')
-        except IOError, ioe:
+        except IOError as ioe:
             raise error.general('opening tty dev: %s: %s' % (dev, ioe))
         except:
@@ -559,7 +559,7 @@
         t.vmin(1)
         t.vtime(2)
-        print t
+        print(t)
         t.set('B115200,~BRKINT,IGNBRK,IGNCR,~ICANON,~ISIG,~IEXTEN,~ECHO,CLOCAL,~CRTSCTS')
-        print t
+        print(t)
         t.on()
         while True:
Index: tester/rt/test.py
===================================================================
--- tester/rt/test.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/test.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -119,5 +119,5 @@
     def reraise(self):
         if self.result is not None:
-            raise self.result[0], self.result[1], self.result[2]
+            raise (self.result[0], self.result[1], self.result[2])
 
     def kill(self):
@@ -158,7 +158,7 @@
             del reported[:]
             if job_trace:
-                print '}} threading:', threading.active_count()
+                print('}} threading:', threading.active_count())
                 for t in threading.enumerate():
-                    print '}} ', t.name
+                    print('}} ', t.name)
     return reporting
 
@@ -303,18 +303,18 @@
         log.notice('Average test time: %s' % (str((end_time - start_time) / total)))
         log.notice('Testing time     : %s' % (str(end_time - start_time)))
-    except error.general, gerr:
-        print gerr
+    except error.general as gerr:
+        print(gerr)
         sys.exit(1)
-    except error.internal, ierr:
-        print ierr
+    except error.internal as ierr:
+        print(ierr)
         sys.exit(1)
-    except error.exit, eerr:
+    except error.exit:
         sys.exit(2)
     except KeyboardInterrupt:
         if opts is not None and opts.find_arg('--stacktrace'):
-            print '}} dumping:', threading.active_count()
+            print('}} dumping:', threading.active_count())
             for t in threading.enumerate():
-                print '}} ', t.name
-            print stacktraces.trace()
+                print('}} ', t.name)
+            print(stacktraces.trace())
         log.notice('abort: user terminated')
         killall(tests)
Index: tester/rt/version.py
===================================================================
--- tester/rt/version.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tester/rt/version.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -43,6 +43,6 @@
 
 if __name__ == '__main__':
-    print 'major = %d' % (major)
-    print 'minor = %d' % (minor)
-    print 'revision = %d' % (revision)
-    print 'Version: %s' % (str())
+    print('major = %d' % (major))
+    print('minor = %d' % (minor))
+    print('revision = %d' % (revision))
+    print('Version: %s' % (str()))
Index: tools/gdb/python/__init__.py
===================================================================
--- tools/gdb/python/__init__.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/__init__.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -38,3 +38,3 @@
 _cmds = rtems.create()
 
-print 'RTEMS GDB Support'
+print('RTEMS GDB Support')
Index: tools/gdb/python/classic.py
===================================================================
--- tools/gdb/python/classic.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/classic.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -148,27 +148,27 @@
     def show(self, from_tty):
         if self.object_control.id() != 0:
-            print '     Name:', self.object_control.name()
-            print '       Id: 0x%08x (@ 0x%08x)' % (self.object_control.id(),
-                                                   self.reference)
-            print '     Attr:', self.attr.to_string()
+            print('     Name:', self.object_control.name())
+            print('       Id: 0x%08x (@ 0x%08x)' % (self.object_control.id(),
+                                                   self.reference))
+            print('     Attr:', self.attr.to_string())
             if self.attr.test('semaphore-type', 'bin-sema') or \
                self.attr.test('semaphore-type', 'simple-bin-sema'):
                 core_mutex = mutex.control(self.object['Core_control']['mutex'])
-                print '  Nesting:', core_mutex.nest_count()
-                print '   Holder:',
+                print('  Nesting:', core_mutex.nest_count())
+                print('   Holder:',)
                 holder = core_mutex.holder()
                 if holder:
-                    print '%s (id 0x%08x)' % (holder.brief(), holder.id())
+                    print('%s (id 0x%08x)' % (holder.brief(), holder.id()))
                 else:
-                    print 'no holder (unlocked)'
+                    print('no holder (unlocked)')
                 wait_queue = core_mutex.wait_queue()
                 tasks = wait_queue.tasks()
-                print '    Queue: len = %d, state = %s' % (len(tasks),
-                                                           wait_queue.state())
+                print('    Queue: len = %d, state = %s' % (len(tasks),
+                                                           wait_queue.state()))
                 if len(tasks) > 0:
-                    print '    Tasks:'
-                    print '    Name (c:current, r:real), (id)'
+                    print('    Tasks:')
+                    print('    Name (c:current, r:real), (id)')
                     for t in range(0, len(tasks)):
-                        print '      ', tasks[t].brief(), ' (%08x)' % (tasks[t].id())
+                        print('      ', tasks[t].brief(), ' (%08x)' % (tasks[t].id()))
                 return True
         return False
@@ -190,19 +190,19 @@
             if cpu == -1:
                 cpu = 'not executing'
-            print '         Id:', '0x%08x (@ 0x%08x)' % (self.task.id(),
-                                                         self.task.reference)
-            print '       Name:', self.task.name()
-            print ' Active CPU:', cpu
-            print '      State:', self.task.current_state()
-            print '    Current:', self.task.current_priority()
-            print '       Real:', self.task.real_priority()
-            print '    Preempt:', self.task.preemptible()
-            print '   T Budget:', self.task.cpu_time_budget()
-            print '       Time:', self.task.cpu_time_used()
-            print '  Resources:', self.task.resource_count()
-            print '  Regsters:'
+            print('         Id:', '0x%08x (@ 0x%08x)' % (self.task.id(),
+                                                         self.task.reference))
+            print('       Name:', self.task.name())
+            print(' Active CPU:', cpu)
+            print('      State:', self.task.current_state())
+            print('    Current:', self.task.current_priority())
+            print('       Real:', self.task.real_priority())
+            print('    Preempt:', self.task.preemptible())
+            print('   T Budget:', self.task.cpu_time_budget())
+            print('       Time:', self.task.cpu_time_used())
+            print('  Resources:', self.task.resource_count())
+            print('  Regsters:')
             for name in self.regs.names():
                 val = self.regs.get(name)
-                print '    %20s: %08x (%d)' % (name, val, val)
+                print('    %20s: %08x (%d)' % (name, val, val))
             return True
         return False
@@ -223,6 +223,6 @@
 
     def show(self, from_tty):
-        print '     Name:', self.object_control.name()
-        print '     Attr:', self.attr.to_string()
+        print('     Name:', self.object_control.name())
+        print('     Attr:', self.attr.to_string())
 
         self.core_control.show()
@@ -238,5 +238,5 @@
 
     def show(self, from_tty):
-        print '     Name:', self.object_control.name()
+        print('     Name:', self.object_control.name())
         self.watchdog.show()
 
@@ -256,9 +256,9 @@
     def show(self, from_tty):
         # ToDo: the printing still somewhat crude.
-        print '     Name:', self.object_control.name()
-        print '     Attr:', self.attr.to_string()
-        print '   Length:', self.length
-        print '   B Size:', self.buffer_size
-        print ' U Blocks:', self.used_blocks
+        print('     Name:', self.object_control.name())
+        print('     Attr:', self.attr.to_string())
+        print('   Length:', self.length)
+        print('   B Size:', self.buffer_size)
+        print(' U Blocks:', self.used_blocks)
 
 class region:
@@ -274,8 +274,8 @@
 
     def show(self, from_tty):
-        print '     Name:', self.object_control.name()
-        print '     Attr:', self.attr.to_string()
+        print('     Name:', self.object_control.name())
+        print('     Attr:', self.attr.to_string())
         helper.tasks_printer_routine(self.wait_queue)
-        print '   Memory:'
+        print('   Memory:')
         self.heap.show()
 
@@ -291,11 +291,11 @@
 
     def show(self,from_tty):
-        print '     Name:',self.object_control.name()
-        print '     Attr:',self.attr.to_string()
+        print('     Name:',self.object_control.name())
+        print('     Attr:',self.attr.to_string())
 
         if self.attr.test('barrier','barrier-auto-release'):
             max_count = self.core_b_control.max_count()
-            print 'Aut Count:', max_count
-
-        print '  Waiting:',self.core_b_control.waiting_threads()
+            print('Aut Count:', max_count)
+
+        print('  Waiting:',self.core_b_control.waiting_threads())
         helper.tasks_printer_routine(self.core_b_control.tasks())
Index: tools/gdb/python/heaps.py
===================================================================
--- tools/gdb/python/heaps.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/heaps.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -74,7 +74,7 @@
 
     def show(self):
-        print '  Instance:',self.inst()
-        print '     Avail:',self.avail()
-        print '      Free:',self.free()
+        print('  Instance:',self.inst())
+        print('     Avail:',self.avail())
+        print('      Free:',self.free())
 
     # ToDo : incorporate others
@@ -106,8 +106,8 @@
         la = self.last()
 
-        print '     First:', fi.val()
-        print '      Last:', la.val()
+        print('     First:', fi.val())
+        print('      Last:', la.val())
 
         stats = self.stat()
-        print '    stats:'
+        print('    stats:')
         stats.show()
Index: tools/gdb/python/helper.py
===================================================================
--- tools/gdb/python/helper.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/helper.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -35,7 +35,7 @@
 def tasks_printer_routine(wait_queue):
     tasks = wait_queue.tasks()
-    print '    Queue: len = %d, state = %s' % (len(tasks),wait_queue.state())
+    print('    Queue: len = %d, state = %s' % (len(tasks),wait_queue.state()))
     for t in range(0, len(tasks)):
-        print '      ', tasks[t].brief(), ' (%08x)' % (tasks[t].id())
+        print('      ', tasks[t].brief(), ' (%08x)' % (tasks[t].id()))
 
 def type_from_value(val):
Index: tools/gdb/python/rtems.py
===================================================================
--- tools/gdb/python/rtems.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/rtems.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -79,13 +79,13 @@
                 num = int(val)
             except:
-                print 'error: "%s" is not a number' % (num)
+                print('error: "%s" is not a number' % (num))
                 return True
             id = objects.ident(num)
             if not id.valid():
-                print 'Invalid object id'
+                print('Invalid object id')
                 return True
 
-            print 'API:%s Class:%s Node:%d Index:%d Id:%08X' % \
-                (id.api(), id._class(), id.node(), id.index(), id.value())
+            print('API:%s Class:%s Node:%d Index:%d Id:%08X' % \
+                (id.api(), id._class(), id.node(), id.index(), id.value()))
             objectname = id.api() + '/' + id._class()
 
@@ -125,11 +125,11 @@
                     if index < maximum:
                         if index < minimum_id.index():
-                            print "error: %s is not an index (min is %d)" % (val,
-                                                                             minimum_id.index())
+                            print("error: %s is not an index (min is %d)" % (val,
+                                                                             minimum_id.index()))
                             return
                     else:
                         index = objects.ident(index).index()
                 except ValueError:
-                    print "error: %s is not an index" % (val)
+                    print("error: %s is not an index" % (val))
                     return
                 try:
@@ -138,5 +138,5 @@
                                                             index)
                 except IndexError:
-                    print "error: index %s is invalid" % (index)
+                    print("error: index %s is invalid" % (index))
                     return
                 instance = self.instance(obj)
@@ -144,11 +144,11 @@
             objects.information.invalidate()
         else:
-            print '-' * 70
-            print ' %s: %d [%08x -> %08x]' % (objects.information.name(self.api, self._class),
-                                             maximum, minimum_id.value(), maximum_id.value())
+            print('-' * 70)
+            print(' %s: %d [%08x -> %08x]' % (objects.information.name(self.api, self._class),
+                                             maximum, minimum_id.value(), maximum_id.value()))
             valid = True
             for index in range(minimum_id.index(), minimum_id.index() + maximum):
                 if valid:
-                    print '-' * 70
+                    print('-' * 70)
                 valid = self.invoke(str(index), from_tty)
         return valid
@@ -250,5 +250,5 @@
     def invoke(self, arg, from_tty):
         if arg:
-            print "warning: commad takes no arguments!"
+            print("warning: commad takes no arguments!")
         obj = objects.information.object_return(self.api, self._class)
         instance = supercore.time_of_day(obj)
@@ -272,5 +272,5 @@
 
         if inst.empty():
-            print '     error: empty chain'
+            print('     error: empty chain')
             return
 
@@ -279,6 +279,6 @@
         while not nd.null():
             wd = watchdog.control(nd.cast('Watchdog_Control'))
-            print ' #'+str(i)
-            print wd.to_string()
+            print(' #'+str(i))
+            print(wd.to_string())
             nd.next()
             i += 1
Index: tools/gdb/python/sparc.py
===================================================================
--- tools/gdb/python/sparc.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/sparc.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -115,28 +115,28 @@
 
     def show(self):
-        print '         Global Regs:',
-        print ' [',
+        print('         Global Regs:',)
+        print(' [',)
         for i in self.global_regs():
-            print str(i)+',',
-        print '\b\b ]'
+            print(str(i)+',',)
+        print('\b\b ]')
 
-        print '          Local Regs:',
-        print ' [',
+        print('          Local Regs:',)
+        print(' [',)
         for i in self.local_regs():
-            print str(i)+',',
-        print '\b\b ]'
+            print(str(i)+',',)
+        print('\b\b ]')
 
-        print '             In Regs:',
-        print ' [',
+        print('             In Regs:',)
+        print(' [',)
         for i in self.in_regs():
-            print str(i)+',',
-        print '\b\b ]'
+            print(str(i)+',',)
+        print('\b\b ]')
 
-        print '            Out Regs:',
-        print ' [',
+        print('            Out Regs:',)
+        print(' [',)
         for i in self.out_regs():
-            print str(i)+',',
-        print '\b\b ]'
+            print(str(i)+',',)
+        print('\b\b ]')
 
         sr = self.status()
-        print sr.to_string()
+        print(sr.to_string())
Index: tools/gdb/python/supercore.py
===================================================================
--- tools/gdb/python/supercore.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/supercore.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -51,11 +51,11 @@
 
     def show(self):
-        print ' Time Of Day'
+        print(' Time Of Day')
 
         if not self.is_set():
-            print ' Application has not set a TOD'
+            print(' Application has not set a TOD')
 
-        print '      Now:', self.now()
-        print '   Uptime:', self.timer()
+        print('      Now:', self.now())
+        print('   Uptime:', self.timer())
 
 
Index: tools/gdb/python/watchdog.py
===================================================================
--- tools/gdb/python/watchdog.py	(revision ab922fec9c2ce403d870120b5afcc108f06f4aea)
+++ tools/gdb/python/watchdog.py	(revision 04a52040aef69910e9ac2218fea48077e34d4017)
@@ -90,3 +90,3 @@
 
     def show(self):
-        print self.to_string()
+        print(self.to_string())
