Skip to content

Commit b7c46c9

Browse files
authored
Merge pull request #112 from a-detiste/master
remove leftover python2 "print"s
2 parents c93d980 + ff1e0da commit b7c46c9

40 files changed

+19
-53
lines changed

doc/listings/copyable-receive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def setCopyableState(self, d):
1818
self.shoe_size = "they wouldn't tell us"
1919

2020
def display(self):
21-
print "Name:", self.name
22-
print "Age:", self.age
23-
print "Shoe Size:", self.shoe_size
21+
print("Name:", self.name)
22+
print("Age:", self.age)
23+
print("Shoe Size:", self.shoe_size)
2424

2525
def getRecord(rref, name):
2626
d = rref.callRemote("getuser", name=name)

doc/listings/copyable-send.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ def remote_getuser(self, name):
3737
tub.listenOn("tcp:12345")
3838
tub.setLocation("localhost:12345")
3939
url = tub.registerReference(db, "database")
40-
print "the database is at:", url
40+
print("the database is at:", url)
4141
tub.startService()
4242
reactor.run()

doc/listings/pb2client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
from foolscap.api import Tub
66

77
def gotError1(why):
8-
print "unable to get the RemoteReference:", why
8+
print("unable to get the RemoteReference:", why)
99
reactor.stop()
1010

1111
def gotError2(why):
12-
print "unable to invoke the remote method:", why
12+
print("unable to invoke the remote method:", why)
1313
reactor.stop()
1414

1515
def gotReference(remote):
16-
print "got a RemoteReference"
17-
print "asking it to add 1+2"
16+
print("got a RemoteReference")
17+
print("asking it to add 1+2")
1818
d = remote.callRemote("add", a=1, b=2)
1919
d.addCallbacks(gotAnswer, gotError2)
2020

2121
def gotAnswer(answer):
22-
print "the answer is", answer
22+
print("the answer is", answer)
2323
reactor.stop()
2424

2525
if len(sys.argv) < 2:
26-
print "Usage: pb2client.py URL"
26+
print("Usage: pb2client.py URL")
2727
sys.exit(1)
2828
url = sys.argv[1]
2929
tub = Tub()

doc/listings/pb2server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def remote_subtract(self, a, b):
1414
tub.listenOn("tcp:12345")
1515
tub.setLocation("localhost:12345")
1616
url = tub.registerReference(myserver, "math-service")
17-
print "the object is available at:", url
17+
print("the object is available at:", url)
1818

1919
tub.startService()
2020
reactor.run()

doc/listings/pb3calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def remote_pop(self):
3535
tub.listenOn("tcp:12345")
3636
tub.setLocation("localhost:12345")
3737
url = tub.registerReference(Calculator(), "calculator")
38-
print "the object is available at:", url
38+
print("the object is available at:", url)
3939

4040
application = service.Application("pb2calculator")
4141
tub.setServiceParent(application)

doc/listings/pb3user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
class Observer(Referenceable):
88
def remote_event(self, msg):
9-
print "event:", msg
9+
print("event:", msg)
1010

1111
def printResult(number):
12-
print "the result is", number
12+
print("the result is", number)
1313
def gotError(err):
14-
print "got an error:", err
14+
print("got an error:", err)
1515
def gotRemote(remote):
1616
o = Observer()
1717
d = remote.callRemote("addObserver", observer=o)

misc/run-deprecations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def run_command(main):
5151
pw = os.environ.get("PYTHONWARNINGS")
5252
DDW = "default::DeprecationWarning"
5353
if pw != DDW:
54-
print "note: $PYTHONWARNINGS is '%s', not the expected %s" % (pw, DDW)
54+
print("note: $PYTHONWARNINGS is '%s', not the expected %s" % (pw, DDW))
5555
sys.stdout.flush()
5656

5757
pp = RunPP()
@@ -84,11 +84,11 @@ def add(line):
8484
if warnings:
8585
if config["warnings"]:
8686
with open(config["warnings"], "wb") as f:
87-
print >>f, "".join(warnings)
88-
print "ERROR: %d deprecation warnings found" % len(warnings)
87+
print("".join(warnings), flush=True)
88+
print("ERROR: %d deprecation warnings found" % len(warnings))
8989
sys.exit(1)
9090

91-
print "no deprecation warnings"
91+
print("no deprecation warnings")
9292
if signal:
9393
sys.exit(signal)
9494
sys.exit(rc)

src/foolscap/appserver/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import six, os, sys, shutil, errno, time, signal
32
from io import StringIO
43
from twisted.python import usage

src/foolscap/appserver/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import six
32
import os, sys
43
from io import BytesIO

src/foolscap/appserver/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import os, sys, json, ast
32
import six
43
from twisted.application import service

src/foolscap/appserver/services.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import unicode_literals
21
import os
32
import six
43
from twisted.python import usage, runtime, filepath, log

src/foolscap/banana.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import six
32
import struct, time
43

src/foolscap/broker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# This module is responsible for the per-connection Broker object
44

5-
from __future__ import print_function
65
import six
76
import types, time
87
from itertools import count

src/foolscap/logging/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import sys
32
from io import StringIO
43
from twisted.python import usage

src/foolscap/logging/dumper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import six, sys, errno, textwrap
32
from twisted.python import usage
43
from foolscap.logging import flogfile

src/foolscap/logging/filter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import six
32
from twisted.python import usage
43
import sys, os, bz2, time

src/foolscap/logging/gatherer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import six, os, sys, time, bz2
32
signal = None
43
try:

src/foolscap/logging/incident.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import six
32
import sys, os.path, time, bz2
43
import json

src/foolscap/logging/log.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import os, sys, time, weakref, binascii
32
import traceback
43
import collections

src/foolscap/logging/publish.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import os
32
from collections import deque
43
import six

src/foolscap/logging/tail.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function, unicode_literals
21
import six, os, sys, time
32
from zope.interface import implementer
43
from twisted.internet import reactor

src/foolscap/logging/web.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import time
32
import six
43
from six.moves.urllib.parse import quote

src/foolscap/negotiate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_negotiate -*-
22

3-
from __future__ import print_function
43
import time
54
import six
65
from twisted.python.failure import Failure

src/foolscap/referenceable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Referenceable (callable) objects. All details of actually invoking methods
55
# live in call.py
66

7-
from __future__ import print_function
87
import weakref
98
from functools import total_ordering
109
import six

src/foolscap/slicers/list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_banana -*-
22

3-
from __future__ import print_function
43
from twisted.python import log
54
from twisted.internet.defer import Deferred
65
from foolscap.tokens import Violation

src/foolscap/slicers/root.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_banana -*-
22

3-
from __future__ import print_function
43
import six
54
from zope.interface import implementer
65
from twisted.internet.defer import Deferred

src/foolscap/slicers/set.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_banana -*-
22

3-
from __future__ import print_function
43
from twisted.internet import defer
54
from twisted.python import log
65
from foolscap.slicers.list import ListSlicer

src/foolscap/slicers/tuple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_banana -*-
22

3-
from __future__ import print_function
43
from twisted.internet.defer import Deferred
54
from foolscap.tokens import Violation
65
from foolscap.slicer import BaseUnslicer

src/foolscap/test/apphelper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
script lets the test work on windows too.
66
"""
77

8-
from __future__ import unicode_literals
98
import sys, os.path
109
import six
1110

src/foolscap/test/bench_banana.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import io
32
from foolscap import storage
43

src/foolscap/test/check-connections-client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#! /usr/bin/python
2-
from __future__ import print_function
32

43
# This is the client side of a manual test for the socks/tor
54
# connection-handler code. To use it, first set up the server as described in

src/foolscap/test/check-connections-server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#! /usr/bin/python
22

3-
from __future__ import print_function
4-
53
# This is the server side of a manual test for the socks/tor
64
# connection-handler code. On the server host, configure Tor to route a
75
# hidden service to our port with something like:

src/foolscap/test/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_pb -*-
22

3-
from __future__ import print_function
43
import six
54
import time
65
from zope.interface import implementer, implementer_only, implementedBy, Interface

src/foolscap/test/test__versions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
from twisted.trial import unittest
32
import time
43
import platform

src/foolscap/test/test_banana.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import six
32
import os
43
import os.path

src/foolscap/test/test_copyable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import six
32
from twisted.trial import unittest
43
from twisted.python import components, failure, reflect

src/foolscap/test/test_gifts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
from zope.interface import implementer
32
from twisted.trial import unittest
43
from twisted.internet import defer, protocol, reactor

src/foolscap/test/test_interfaces.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_interfaces -*-
22

3-
from __future__ import print_function
43
from zope.interface import implementer_only
54
from twisted.trial import unittest
65

src/foolscap/test/test_pb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_pb -*-
22

3-
from __future__ import print_function
43
import re
54

65
if False:

src/foolscap/test/test_tub.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- test-case-name: foolscap.test.test_tub -*-
22

3-
from __future__ import print_function
43
import os.path
54
import os
65
from twisted.trial import unittest

0 commit comments

Comments
 (0)