summaryrefslogtreecommitdiffstats
path: root/Lib/poplib.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
commit70a6b49821a3226f55e9716f32d802d06640cb89 (patch)
tree3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Lib/poplib.py
parentecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff)
downloadcpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Lib/poplib.py')
-rw-r--r--Lib/poplib.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index c14b8b7..1475bdc 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*', `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*', `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*', `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*', `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*', `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*', `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*', `line`
+ if self._debugging > 1: print '*put*', repr(line)
line += CRLF
bytes = len(line)
while bytes > 0:
@@ -416,7 +416,7 @@ if __name__ == "__main__":
(numMsgs, totalSize) = a.stat()
for i in range(1, numMsgs + 1):
(header, msg, octets) = a.retr(i)
- print "Message ", `i`, ':'
+ print "Message %d:" % i
for line in msg:
print ' ' + line
print '-----------------------'