Index: twisted/test/iosim.py
===================================================================
--- twisted/test/iosim.py	(revision 35029)
+++ twisted/test/iosim.py	(working copy)
@@ -182,8 +182,11 @@
     ft.protocol = s
     return ft
 
+
+
 class IOPump:
-    """Utility to pump data between clients and servers for protocol testing.
+    """
+    Utility to pump data between clients and servers for protocol testing.
 
     Perhaps this is a utility worthy of being in protocol.py?
     """
@@ -194,8 +197,10 @@
         self.serverIO = serverIO
         self.debug = debug
 
+
     def flush(self, debug=False):
-        """Pump until there is no more input or output.
+        """
+        Pump until there is no more input or output.
 
         Returns whether any data was moved.
         """
@@ -211,23 +216,24 @@
 
 
     def pump(self, debug=False):
-        """Move data back and forth.
+        """
+        Move data back and forth.
 
         Returns whether any data was moved.
         """
         if self.debug or debug:
-            print '-- GLUG --'
+            print('-- GLUG --')
         sData = self.serverIO.getOutBuffer()
         cData = self.clientIO.getOutBuffer()
         self.clientIO._checkProducer()
         self.serverIO._checkProducer()
         if self.debug or debug:
-            print '.'
+            print('.')
             # XXX slightly buggy in the face of incremental output
             if cData:
-                print 'C: '+repr(cData)
+                print('C: ' + repr(cData))
             if sData:
-                print 'S: '+repr(sData)
+                print('S: ' + repr(sData))
         if cData:
             self.serverIO.bufferReceived(cData)
         if sData:
@@ -237,14 +243,14 @@
         if (self.serverIO.disconnecting and
             not self.serverIO.disconnected):
             if self.debug or debug:
-                print '* C'
+                print('* C')
             self.serverIO.disconnected = True
             self.clientIO.disconnecting = True
             self.clientIO.reportDisconnect()
             return True
         if self.clientIO.disconnecting and not self.clientIO.disconnected:
             if self.debug or debug:
-                print '* S'
+                print('* S')
             self.clientIO.disconnected = True
             self.serverIO.disconnecting = True
             self.serverIO.reportDisconnect()
Index: twisted/test/process_fds.py
===================================================================
--- twisted/test/process_fds.py	(revision 35029)
+++ twisted/test/process_fds.py	(working copy)
@@ -1,40 +1,51 @@
-
-"""Write to a handful of file descriptors, to test the childFDs= argument of
+"""
+Write to a handful of file descriptors, to test the childFDs= argument of
 reactor.spawnProcess()
 """
 
+from __future__ import print_function
+
 import os, sys
 
 debug = 0
 
-if debug: stderr = os.fdopen(2, "w")
+if debug:
+    stderr = os.fdopen(2, "w")
 
-if debug: print >>stderr, "this is stderr"
+if debug:
+    print("this is stderr", file=stderr)
 
 abcd = os.read(0, 4)
-if debug: print >>stderr, "read(0):", abcd
+if debug:
+    print("read(0):", abcd, file=stderr)
 if abcd != "abcd":
     sys.exit(1)
 
-if debug: print >>stderr, "os.write(1, righto)"
+if debug:
+    print("os.write(1, righto)", file=stderr)
 
 os.write(1, "righto")
 
 efgh = os.read(3, 4)
-if debug: print >>stderr, "read(3):", efgh
+if debug:
+    print("read(3):", efgh, file=stderr)
 if efgh != "efgh":
     sys.exit(2)
 
-if debug: print >>stderr, "os.close(4)"
+if debug:
+    print("os.close(4)", file=stderr)
 os.close(4)
 
 eof = os.read(5, 4)
-if debug: print >>stderr, "read(5):", eof
+if debug:
+    print("read(5):", eof, file=stderr)
 if eof != "":
     sys.exit(3)
 
-if debug: print >>stderr, "os.write(1, closed)"
+if debug:
+    print("os.write(1, closed)", file=stderr)
 os.write(1, "closed")
 
-if debug: print >>stderr, "sys.exit(0)"
+if debug:
+    print("sys.exit(0)", file=stderr)
 sys.exit(0)
Index: twisted/test/process_linger.py
===================================================================
--- twisted/test/process_linger.py	(revision 35029)
+++ twisted/test/process_linger.py	(working copy)
@@ -1,13 +1,13 @@
-
-"""Write to a file descriptor and then close it, waiting a few seconds before
+"""
+Write to a file descriptor and then close it, waiting a few seconds before
 quitting. This serves to make sure SIGCHLD is actually being noticed.
 """
 
 import os, sys, time
 
-print "here is some text"
+print("here is some text")
 time.sleep(1)
-print "goodbye"
+print("goodbye")
 os.close(1)
 os.close(2)
 
Index: twisted/test/process_twisted.py
===================================================================
--- twisted/test/process_twisted.py	(revision 35029)
+++ twisted/test/process_twisted.py	(working copy)
@@ -1,4 +1,8 @@
-"""A process that reads from stdin and out using Twisted."""
+"""
+A process that reads from stdin and out using Twisted.
+"""
+
+from __future__ import print_function
 
 ### Twisted Preamble
 # This makes sure that users don't have to set up their environment
@@ -24,19 +28,19 @@
     implements(interfaces.IHalfCloseableProtocol)
     
     def connectionMade(self):
-        print "connection made"
+        print("connection made")
     
     def dataReceived(self, data):
         self.transport.write(data)
 
     def readConnectionLost(self):
-        print "readConnectionLost"
+        print("readConnectionLost")
         self.transport.loseConnection()
     def writeConnectionLost(self):
-        print "writeConnectionLost"
+        print("writeConnectionLost")
     
     def connectionLost(self, reason):
-        print "connectionLost", reason
+        print("connectionLost", reason)
         reactor.stop()
 
 stdio.StandardIO(Echo())
Index: twisted/test/test_tcp.py
===================================================================
--- twisted/test/test_tcp.py	(revision 35029)
+++ twisted/test/test_tcp.py	(working copy)
@@ -5,6 +5,8 @@
 Tests for implementations of L{IReactorTCP}.
 """
 
+from __future__ import print_function
+
 import socket, random, errno
 
 from zope.interface import implements
@@ -850,16 +852,18 @@
         self.transport.writeSequence(seq)
         peer = self.transport.getPeer()
         if peer.type != "TCP":
-            print "getPeer returned non-TCP socket:", peer
+            print("getPeer returned non-TCP socket:", peer)
             self.factory.problem = 1
         us = self.transport.getHost()
         if us.type != "TCP":
-            print "getHost returned non-TCP socket:", us
+            print("getHost returned non-TCP socket:", us)
             self.factory.problem = 1
         self.factory.done = 1
 
         self.transport.loseConnection()
 
+
+
 class ReaderProtocol(protocol.Protocol):
     def dataReceived(self, data):
         self.factory.data += data
Index: twisted/test/process_cmdline.py
===================================================================
--- twisted/test/process_cmdline.py	(revision 35029)
+++ twisted/test/process_cmdline.py	(working copy)
@@ -1,5 +1,7 @@
-"""Write to stdout the command line args it received, one per line."""
+"""
+Write to stdout the command line args it received, one per line.
+"""
 
 import sys
 for x in sys.argv[1:]:
-    print x
+    print(x)
Index: twisted/test/test_log.py
===================================================================
--- twisted/test/test_log.py	(revision 35029)
+++ twisted/test/test_log.py	(working copy)
@@ -5,6 +5,8 @@
 Tests for L{twisted.python.log}.
 """
 
+from __future__ import print_function
+
 import os, sys, time, logging, warnings, calendar
 from cStringIO import StringIO
 
@@ -737,8 +739,8 @@
         oldStdout = sys.stdout
         sys.stdout = log.StdioOnnaStick()
         self.addCleanup(setattr, sys, "stdout", oldStdout)
-        print "This",
-        print "is a test"
+        print("This", end=' ')
+        print("is a test")
         self.assertEqual(self.getLogMessages(), ["This is a test"])
 
 
@@ -765,7 +767,7 @@
         sys.stdout = stdio
         self.addCleanup(setattr, sys, "stdout", oldStdout)
         # This should go to the log, utf-8 encoded too:
-        print unicodeString
+        print(unicodeString)
         self.assertEqual(self.getLogMessages(),
                          [unicodeString.encode("utf-8"),
                           (u"Also, " + unicodeString).encode("utf-8"),
Index: twisted/test/process_signal.py
===================================================================
--- twisted/test/process_signal.py	(revision 35029)
+++ twisted/test/process_signal.py	(working copy)
@@ -3,6 +3,6 @@
 signal.signal(signal.SIGINT, signal.SIG_DFL)
 if getattr(signal, "SIGHUP", None) is not None:
     signal.signal(signal.SIGHUP, signal.SIG_DFL)
-print 'ok, signal us'
+print('ok, signal us')
 sys.stdin.read()
 sys.exit(1)
Index: twisted/test/test_process.py
===================================================================
--- twisted/test/test_process.py	(revision 35029)
+++ twisted/test/test_process.py	(working copy)
@@ -5,6 +5,8 @@
 Test running processes.
 """
 
+from __future__ import print_function
+
 import gzip
 import os
 import sys
@@ -766,6 +768,8 @@
         self.finished = 1
         self.deferred.callback(None)
 
+
+
 class TestTwoProcessesBase:
     def setUp(self):
         self.processes = [None, None]
@@ -773,6 +777,7 @@
         self.done = 0
         self.verbose = 0
 
+
     def createProcesses(self, usePTY=0):
         exe = sys.executable
         scriptPath = util.sibpath(__file__, "process_reader.py")
@@ -784,27 +789,34 @@
                                      usePTY=usePTY)
             self.processes[num] = p
 
+
     def close(self, num):
-        if self.verbose: print "closing stdin [%d]" % num
+        if self.verbose: print("closing stdin [%d]" % num)
         p = self.processes[num]
         pp = self.pp[num]
         self.failIf(pp.finished, "Process finished too early")
         p.loseConnection()
-        if self.verbose: print self.pp[0].finished, self.pp[1].finished
+        if self.verbose: print(self.pp[0].finished, self.pp[1].finished)
+
 
     def _onClose(self):
         return defer.gatherResults([ p.deferred for p in self.pp ])
 
-    def testClose(self):
-        if self.verbose: print "starting processes"
+
+    def test_close(self):
+        if self.verbose: print("starting processes")
         self.createProcesses()
         reactor.callLater(1, self.close, 0)
         reactor.callLater(2, self.close, 1)
         return self._onClose()
 
+
+
 class TestTwoProcessesNonPosix(TestTwoProcessesBase, unittest.TestCase):
     pass
 
+
+
 class TestTwoProcessesPosix(TestTwoProcessesBase, unittest.TestCase):
     def tearDown(self):
         for pp, pr in zip(self.pp, self.processes):
@@ -817,35 +829,40 @@
                     pass
         return self._onClose()
 
+
     def kill(self, num):
-        if self.verbose: print "kill [%d] with SIGTERM" % num
+        if self.verbose: print("kill [%d] with SIGTERM" % num)
         p = self.processes[num]
         pp = self.pp[num]
         self.failIf(pp.finished, "Process finished too early")
         os.kill(p.pid, signal.SIGTERM)
-        if self.verbose: print self.pp[0].finished, self.pp[1].finished
+        if self.verbose: print(self.pp[0].finished, self.pp[1].finished)
 
-    def testKill(self):
-        if self.verbose: print "starting processes"
+
+    def test_kill(self):
+        if self.verbose: print("starting processes")
         self.createProcesses(usePTY=0)
         reactor.callLater(1, self.kill, 0)
         reactor.callLater(2, self.kill, 1)
         return self._onClose()
 
-    def testClosePty(self):
-        if self.verbose: print "starting processes"
+    def test_closePty(self):
+        if self.verbose: print("starting processes")
         self.createProcesses(usePTY=1)
         reactor.callLater(1, self.close, 0)
         reactor.callLater(2, self.close, 1)
         return self._onClose()
 
-    def testKillPty(self):
-        if self.verbose: print "starting processes"
+
+    def test_killPty(self):
+        if self.verbose: print("starting processes")
         self.createProcesses(usePTY=1)
         reactor.callLater(1, self.kill, 0)
         reactor.callLater(2, self.kill, 1)
         return self._onClose()
 
+
+
 class FDChecker(protocol.ProcessProtocol):
     state = 0
     data = ""
