diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2003-05-13 18:14:25 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2003-05-13 18:14:25 (GMT) |
commit | ac6df95d07aa3951f8bfc6febce132e09850db73 (patch) | |
tree | 5bc66133d5d093e099b622ac3cd35e216f60a389 /Tools/scripts/finddiv.py | |
parent | bf1bef820c5af6b0a9a60abe1564ac35f036fdcb (diff) | |
download | cpython-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-x | Tools/scripts/finddiv.py | 16 |
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): |