Mercurial > cpython-lru_cache-weakref
diff Lib/gopherlib.py @ 31515:71a294bd7950 legacy-trunk
Replace backticks with repr() or "%r"
From SF patch #852334.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Thu, 12 Feb 2004 17:35:32 +0000 |
| parents | 8360c74d053b |
| children | c5650dbf936e |
line wrap: on
line diff
--- a/Lib/gopherlib.py Thu Feb 12 15:28:27 2004 +0000 +++ b/Lib/gopherlib.py Thu Feb 12 17:35:32 2004 +0000 @@ -47,7 +47,7 @@ _type_to_name_map[eval(name)] = name[2:] if gtype in _type_to_name_map: return _type_to_name_map[gtype] - return 'TYPE=' + `gtype` + return 'TYPE=%r' % (gtype,) # Names for characters and strings CRLF = '\r\n' @@ -113,7 +113,7 @@ gtype = line[0] parts = line[1:].split(TAB) if len(parts) < 4: - print '(Bad line from server:', `line`, ')' + print '(Bad line from server: %r)' % (line,) continue if len(parts) > 4: if parts[4:] != ['+']: @@ -198,7 +198,7 @@ for item in entries: print item else: data = get_binary(f) - print 'binary data:', len(data), 'bytes:', `data[:100]`[:40] + print 'binary data:', len(data), 'bytes:', repr(data[:100])[:40] # Run the test when run as script if __name__ == '__main__':
