summaryrefslogtreecommitdiffstats
path: root/Lib/poplib.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/poplib.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/poplib.py')
-rw-r--r--Lib/poplib.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index b7a7a8a..adf784f 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -100,14 +100,14 @@ class POP3:
def _putline(self, line):
- if self._debugging > 1: print '*put*', repr(line)
+ if self._debugging > 1: print('*put*', repr(line))
self.sock.sendall('%s%s' % (line, CRLF))
# Internal: send one command to the server (through _putline())
def _putcmd(self, line):
- if self._debugging: print '*cmd*', repr(line)
+ if self._debugging: print('*cmd*', repr(line))
self._putline(line)
@@ -117,7 +117,7 @@ class POP3:
def _getline(self):
line = self.file.readline()
- if self._debugging > 1: print '*get*', repr(line)
+ if self._debugging > 1: print('*get*', repr(line))
if not line: raise error_proto('-ERR EOF')
octets = len(line)
# server can send any combination of CR & LF
@@ -135,7 +135,7 @@ class POP3:
def _getresp(self):
resp, o = self._getline()
- if self._debugging > 1: print '*resp*', repr(resp)
+ if self._debugging > 1: print('*resp*', repr(resp))
c = resp[:1]
if c != '+':
raise error_proto(resp)
@@ -209,7 +209,7 @@ class POP3:
"""
retval = self._shortcmd('STAT')
rets = retval.split()
- if self._debugging: print '*stat*', repr(rets)
+ if self._debugging: print('*stat*', repr(rets))
numMessages = int(rets[1])
sizeMessages = int(rets[2])
return (numMessages, sizeMessages)
@@ -375,7 +375,7 @@ class POP3_SSL(POP3):
match = renewline.match(self.buffer)
line = match.group(0)
self.buffer = renewline.sub('' ,self.buffer, 1)
- if self._debugging > 1: print '*get*', repr(line)
+ if self._debugging > 1: print('*get*', repr(line))
octets = len(line)
if line[-2:] == CRLF:
@@ -385,7 +385,7 @@ class POP3_SSL(POP3):
return line[:-1], octets
def _putline(self, line):
- if self._debugging > 1: print '*put*', repr(line)
+ if self._debugging > 1: print('*put*', repr(line))
line += CRLF
bytes = len(line)
while bytes > 0:
@@ -409,15 +409,15 @@ class POP3_SSL(POP3):
if __name__ == "__main__":
import sys
a = POP3(sys.argv[1])
- print a.getwelcome()
+ print(a.getwelcome())
a.user(sys.argv[2])
a.pass_(sys.argv[3])
a.list()
(numMsgs, totalSize) = a.stat()
for i in range(1, numMsgs + 1):
(header, msg, octets) = a.retr(i)
- print "Message %d:" % i
+ print("Message %d:" % i)
for line in msg:
- print ' ' + line
- print '-----------------------'
+ print(' ' + line)
+ print('-----------------------')
a.quit()