From be19ed77ddb047e02fe94d142181062af6d99dcc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 9 Feb 2007 05:37:30 +0000 Subject: 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.) --- Lib/poplib.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Lib/poplib.py') diff --git a/Lib/poplib.py b/Lib/poplib.py index b7a7a8af75..adf784f6dd 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() -- cgit v1.2.1