summaryrefslogtreecommitdiffstats
path: root/Lib/gopherlib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/gopherlib.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/gopherlib.py')
-rw-r--r--Lib/gopherlib.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/gopherlib.py b/Lib/gopherlib.py
index d789161..2fad21c 100644
--- a/Lib/gopherlib.py
+++ b/Lib/gopherlib.py
@@ -103,7 +103,7 @@ def get_directory(f):
while 1:
line = f.readline()
if not line:
- print '(Unexpected EOF from server)'
+ print('(Unexpected EOF from server)')
break
if line[-2:] == CRLF:
line = line[:-2]
@@ -112,17 +112,17 @@ def get_directory(f):
if line == '.':
break
if not line:
- print '(Empty line from server)'
+ print('(Empty line from server)')
continue
gtype = line[0]
parts = line[1:].split(TAB)
if len(parts) < 4:
- print '(Bad line from server: %r)' % (line,)
+ print('(Bad line from server: %r)' % (line,))
continue
if len(parts) > 4:
if parts[4:] != ['+']:
- print '(Extra info from server:',
- print parts[4:], ')'
+ print('(Extra info from server:', end=' ')
+ print(parts[4:], ')')
else:
parts.append('')
parts.insert(0, gtype)
@@ -140,7 +140,7 @@ def get_alt_textfile(f, func):
while 1:
line = f.readline()
if not line:
- print '(Unexpected EOF from server)'
+ print('(Unexpected EOF from server)')
break
if line[-2:] == CRLF:
line = line[:-2]
@@ -196,13 +196,13 @@ def test():
f = send_selector(selector, host)
if type == A_TEXT:
lines = get_textfile(f)
- for item in lines: print item
+ for item in lines: print(item)
elif type in (A_MENU, A_INDEX):
entries = get_directory(f)
- for item in entries: print item
+ for item in entries: print(item)
else:
data = get_binary(f)
- print 'binary data:', len(data), 'bytes:', repr(data[:100])[:40]
+ print('binary data:', len(data), 'bytes:', repr(data[:100])[:40])
# Run the test when run as script
if __name__ == '__main__':