Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/checkappend.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 | 8a7a2f1f88f0 |
| children | 6b18a095c2e7 |
line wrap: on
line diff
--- a/Tools/scripts/checkappend.py Thu Feb 12 15:28:27 2004 +0000 +++ b/Tools/scripts/checkappend.py Thu Feb 12 17:35:32 2004 +0000 @@ -65,7 +65,7 @@ def check(file): if os.path.isdir(file) and not os.path.islink(file): if verbose: - print "%s: listing directory" % `file` + print "%r: listing directory" % (file,) names = os.listdir(file) for name in names: fullname = os.path.join(file, name) @@ -78,15 +78,15 @@ try: f = open(file) except IOError, msg: - errprint("%s: I/O Error: %s" % (`file`, str(msg))) + errprint("%r: I/O Error: %s" % (file, msg)) return if verbose > 1: - print "checking", `file`, "..." + print "checking %r ..." % (file,) ok = AppendChecker(file, f).run() if verbose and ok: - print "%s: Clean bill of health." % `file` + print "%r: Clean bill of health." % (file,) [FIND_DOT, FIND_APPEND, @@ -105,7 +105,7 @@ try: tokenize.tokenize(self.file.readline, self.tokeneater) except tokenize.TokenError, msg: - errprint("%s: Token Error: %s" % (`self.fname`, str(msg))) + errprint("%r: Token Error: %s" % (self.fname, msg)) self.nerrors = self.nerrors + 1 return self.nerrors == 0 @@ -159,7 +159,7 @@ state = FIND_DOT else: - raise SystemError("unknown internal state '%s'" % `state`) + raise SystemError("unknown internal state '%r'" % (state,)) self.state = state
