summaryrefslogtreecommitdiff
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 +0000
commite3092eaa8a5f3da2eb485fb5e49d7c731714ec1e (patch)
tree21847d71ce617166725fb1d94bf90dc6799a1a49 /Lib/nntplib.py
parent5139e90991014c04ec72a22dcc2625152ce7e612 (diff)
downloadcpython-e3092eaa8a5f3da2eb485fb5e49d7c731714ec1e.tar.gz
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/nntplib.py')
-rw-r--r--Lib/nntplib.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 6e6a2b6d0d..3f933f9d22 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -175,7 +175,7 @@ class NNTP:
If the response code is 200, posting is allowed;
if it 201, posting is not allowed."""
- if self.debugging: print '*welcome*', repr(self.welcome)
+ if self.debugging: print('*welcome*', repr(self.welcome))
return self.welcome
def set_debuglevel(self, level):
@@ -190,12 +190,12 @@ class NNTP:
def putline(self, line):
"""Internal: send one line to the server, appending CRLF."""
line = line + CRLF
- if self.debugging > 1: print '*put*', repr(line)
+ if self.debugging > 1: print('*put*', repr(line))
self.sock.sendall(line)
def putcmd(self, line):
"""Internal: send one command to the server (through putline())."""
- if self.debugging: print '*cmd*', repr(line)
+ if self.debugging: print('*cmd*', repr(line))
self.putline(line)
def getline(self):
@@ -203,7 +203,7 @@ class NNTP:
Raise EOFError if the connection is closed."""
line = self.file.readline()
if self.debugging > 1:
- print '*get*', repr(line)
+ print('*get*', repr(line))
if not line: raise EOFError
if line[-2:] == CRLF: line = line[:-2]
elif line[-1:] in CRLF: line = line[:-1]
@@ -213,7 +213,7 @@ class NNTP:
"""Internal: get a response from the server.
Raise various errors if the response indicates an error."""
resp = self.getline()
- if self.debugging: print '*resp*', repr(resp)
+ if self.debugging: print('*resp*', repr(resp))
c = resp[:1]
if c == '4':
raise NNTPTemporaryError(resp)
@@ -618,11 +618,11 @@ if __name__ == '__main__':
mode = None
s = NNTP(newshost, readermode=mode)
resp, count, first, last, name = s.group('comp.lang.python')
- print resp
- print 'Group', name, 'has', count, 'articles, range', first, 'to', last
+ print(resp)
+ print('Group', name, 'has', count, 'articles, range', first, 'to', last)
resp, subs = s.xhdr('subject', first + '-' + last)
- print resp
+ print(resp)
for item in subs:
- print "%7s %s" % item
+ print("%7s %s" % item)
resp = s.quit()
- print resp
+ print(resp)