diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
commit | 70a6b49821a3226f55e9716f32d802d06640cb89 (patch) | |
tree | 3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Tools/scripts/fixcid.py | |
parent | ecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff) | |
download | cpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2 |
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Tools/scripts/fixcid.py')
-rwxr-xr-x | Tools/scripts/fixcid.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py index 8bc1de0..76841fe 100755 --- a/Tools/scripts/fixcid.py +++ b/Tools/scripts/fixcid.py @@ -93,7 +93,7 @@ def wanted(name): return regex.match(Wanted, name) >= 0 def recursedown(dirname): - dbg('recursedown(' + `dirname` + ')\n') + dbg('recursedown(%r)\n' % (dirname,)) bad = 0 try: names = os.listdir(dirname) @@ -115,7 +115,7 @@ def recursedown(dirname): return bad def fix(filename): -## dbg('fix(' + `filename` + ')\n') +## dbg('fix(%r)\n' % (filename,)) if filename == '-': # Filter mode f = sys.stdin @@ -158,7 +158,7 @@ def fix(filename): initfixline() rep(filename + ':\n') continue # restart from the beginning - rep(`lineno` + '\n') + rep(repr(lineno) + '\n') rep('< ' + line) rep('> ' + newline) if g is not None: @@ -225,7 +225,7 @@ def initfixline(): def fixline(line): global Program -## print '-->', `line` +## print '-->', repr(line) i = 0 while i < len(line): i = Program.search(line, i) @@ -293,8 +293,7 @@ def addsubst(substfile): if len(words) == 3 and words[0] == 'struct': words[:2] = [words[0] + ' ' + words[1]] elif len(words) <> 2: - err(substfile + ':' + `lineno` + - ': warning: bad line: ' + line) + err(substfile + '%s:%r: warning: bad line: %r' % (substfile, lineno, line)) continue if Reverse: [value, key] = words @@ -306,11 +305,8 @@ def addsubst(substfile): key = key[1:] NotInComment[key] = value if Dict.has_key(key): - err(substfile + ':' + `lineno` + - ': warning: overriding: ' + - key + ' ' + value + '\n') - err(substfile + ':' + `lineno` + - ': warning: previous: ' + Dict[key] + '\n') + err('%s:%r: warning: overriding: %r %r\n' % (substfile, lineno, key, value)) + err('%s:%r: warning: previous: %r\n' % (substfile, lineno, Dict[key])) Dict[key] = value fp.close() |