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/pathfix.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/pathfix.py')
-rwxr-xr-x | Tools/scripts/pathfix.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py index 81c5a6e..47ae464 100755 --- a/Tools/scripts/pathfix.py +++ b/Tools/scripts/pathfix.py @@ -64,12 +64,12 @@ def ispython(name): return ispythonprog.match(name) >= 0 def recursedown(dirname): - dbg('recursedown(' + `dirname` + ')\n') + dbg('recursedown(%r)\n' % (dirname,)) bad = 0 try: names = os.listdir(dirname) except os.error, msg: - err(dirname + ': cannot list directory: ' + `msg` + '\n') + err('%s: cannot list directory: %r\n' % (dirname, msg)) return 1 names.sort() subdirs = [] @@ -86,11 +86,11 @@ def recursedown(dirname): return bad def fix(filename): -## dbg('fix(' + `filename` + ')\n') +## dbg('fix(%r)\n' % (filename,)) try: f = open(filename, 'r') except IOError, msg: - err(filename + ': cannot open: ' + `msg` + '\n') + err('%s: cannot open: %r\n' % (filename, msg)) return 1 line = f.readline() fixed = fixline(line) @@ -104,7 +104,7 @@ def fix(filename): g = open(tempname, 'w') except IOError, msg: f.close() - err(tempname+': cannot create: '+`msg`+'\n') + err('%s: cannot create: %r\n' % (tempname, msg)) return 1 rep(filename + ': updating\n') g.write(fixed) @@ -123,17 +123,17 @@ def fix(filename): statbuf = os.stat(filename) os.chmod(tempname, statbuf[ST_MODE] & 07777) except os.error, msg: - err(tempname + ': warning: chmod failed (' + `msg` + ')\n') + err('%s: warning: chmod failed (%r)\n' % (tempname, msg)) # Then make a backup of the original file as filename~ try: os.rename(filename, filename + '~') except os.error, msg: - err(filename + ': warning: backup failed (' + `msg` + ')\n') + err('%s: warning: backup failed (%r)\n' % (filename, msg)) # Now move the temp file to the original file try: os.rename(tempname, filename) except os.error, msg: - err(filename + ': rename failed (' + `msg` + ')\n') + err('%s: rename failed (%r)\n' % (filename, msg)) return 1 # Return succes return 0 |