summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/untabify.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-05-13 18:14:25 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-05-13 18:14:25 (GMT)
commitac6df95d07aa3951f8bfc6febce132e09850db73 (patch)
tree5bc66133d5d093e099b622ac3cd35e216f60a389 /Tools/scripts/untabify.py
parentbf1bef820c5af6b0a9a60abe1564ac35f036fdcb (diff)
downloadcpython-ac6df95d07aa3951f8bfc6febce132e09850db73.zip
cpython-ac6df95d07aa3951f8bfc6febce132e09850db73.tar.gz
cpython-ac6df95d07aa3951f8bfc6febce132e09850db73.tar.bz2
Fix use of 'file' as a variable name.
(I've tested the fixes, but please proofread anyway.)
Diffstat (limited to 'Tools/scripts/untabify.py')
-rwxr-xr-xTools/scripts/untabify.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Tools/scripts/untabify.py b/Tools/scripts/untabify.py
index 5eaf50e..17e9166 100755
--- a/Tools/scripts/untabify.py
+++ b/Tools/scripts/untabify.py
@@ -20,33 +20,33 @@ def main():
if optname == '-t':
tabsize = int(optvalue)
- for file in args:
- process(file, tabsize)
+ for filename in args:
+ process(filename, tabsize)
-def process(file, tabsize):
+def process(filename, tabsize):
try:
- f = open(file)
+ f = open(filename)
text = f.read()
f.close()
except IOError, msg:
- print "%s: I/O error: %s" % (`file`, str(msg))
+ print "%s: I/O error: %s" % (`filename`, str(msg))
return
newtext = text.expandtabs(tabsize)
if newtext == text:
return
- backup = file + "~"
+ backup = filename + "~"
try:
os.unlink(backup)
except os.error:
pass
try:
- os.rename(file, backup)
+ os.rename(filename, backup)
except os.error:
pass
- f = open(file, "w")
+ f = open(filename, "w")
f.write(newtext)
f.close()
- print file
+ print filename
if __name__ == '__main__':
main()