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/objgraph.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/objgraph.py')
-rwxr-xr-x | Tools/scripts/objgraph.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Tools/scripts/objgraph.py b/Tools/scripts/objgraph.py index 3e040b9..c48a425 100755 --- a/Tools/scripts/objgraph.py +++ b/Tools/scripts/objgraph.py @@ -63,9 +63,9 @@ undef2file = {} # Read one input file and merge the data into the tables. # Argument is an open file. # -def readinput(file): +def readinput(fp): while 1: - s = file.readline() + s = fp.readline() if not s: break # If you get any output from this line, @@ -88,9 +88,9 @@ def readinput(file): def printcallee(): flist = file2undef.keys() flist.sort() - for file in flist: - print file + ':' - elist = file2undef[file] + for filename in flist: + print filename + ':' + elist = file2undef[filename] elist.sort() for ext in elist: if len(ext) >= 8: @@ -107,38 +107,38 @@ def printcallee(): def printcaller(): files = file2def.keys() files.sort() - for file in files: + for filename in files: callers = [] - for label in file2def[file]: + for label in file2def[filename]: if undef2file.has_key(label): callers = callers + undef2file[label] if callers: callers.sort() - print file + ':' + print filename + ':' lastfn = '' for fn in callers: if fn <> lastfn: print '\t' + fn lastfn = fn else: - print file + ': unused' + print filename + ': unused' -# Print undefine names and where they are used. +# Print undefined names and where they are used. # def printundef(): undefs = {} - for file in file2undef.keys(): - for ext in file2undef[file]: + for filename in file2undef.keys(): + for ext in file2undef[filename]: if not def2file.has_key(ext): - store(undefs, ext, file) + store(undefs, ext, filename) elist = undefs.keys() elist.sort() for ext in elist: print ext + ':' flist = undefs[ext] flist.sort() - for file in flist: - print '\t' + file + for filename in flist: + print '\t' + filename # Print warning messages about names defined in more than one file. # @@ -181,11 +181,11 @@ def main(): optu = optc = optd = 1 if not args: args = ['-'] - for file in args: - if file == '-': + for filename in args: + if filename == '-': readinput(sys.stdin) else: - readinput(open(file, 'r')) + readinput(open(filename, 'r')) # warndups() # |