summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/finddiv.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/finddiv.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/finddiv.py')
-rwxr-xr-xTools/scripts/finddiv.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Tools/scripts/finddiv.py b/Tools/scripts/finddiv.py
index 47b6f12..97f6331 100755
--- a/Tools/scripts/finddiv.py
+++ b/Tools/scripts/finddiv.py
@@ -37,8 +37,8 @@ def main():
if o == "-l":
listnames = 1
exit = None
- for file in args:
- x = process(file, listnames)
+ for filename in args:
+ x = process(filename, listnames)
exit = exit or x
return exit
@@ -47,11 +47,11 @@ def usage(msg):
sys.stderr.write("Usage: %s [-l] file ...\n" % sys.argv[0])
sys.stderr.write("Try `%s -h' for more information.\n" % sys.argv[0])
-def process(file, listnames):
- if os.path.isdir(file):
- return processdir(file, listnames)
+def process(filename, listnames):
+ if os.path.isdir(filename):
+ return processdir(filename, listnames)
try:
- fp = open(file)
+ fp = open(filename)
except IOError, msg:
sys.stderr.write("Can't open: %s\n" % msg)
return 1
@@ -60,11 +60,11 @@ def process(file, listnames):
for type, token, (row, col), end, line in g:
if token in ("/", "/="):
if listnames:
- print file
+ print filename
break
if row != lastrow:
lastrow = row
- print "%s:%d:%s" % (file, row, line),
+ print "%s:%d:%s" % (filename, row, line),
fp.close()
def processdir(dir, listnames):