summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/objgraph.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/scripts/objgraph.py
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/scripts/objgraph.py')
-rwxr-xr-xTools/scripts/objgraph.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/Tools/scripts/objgraph.py b/Tools/scripts/objgraph.py
index f74c2b6..85e6a69 100755
--- a/Tools/scripts/objgraph.py
+++ b/Tools/scripts/objgraph.py
@@ -80,7 +80,7 @@ def readinput(fp):
store(file2undef, fn, name)
store(undef2file, name, fn)
elif not type in ignore:
- print fn + ':' + name + ': unknown type ' + type
+ print(fn + ':' + name + ': unknown type ' + type)
# Print all names that were undefined in some module and where they are
# defined.
@@ -89,7 +89,7 @@ def printcallee():
flist = file2undef.keys()
flist.sort()
for filename in flist:
- print filename + ':'
+ print(filename + ':')
elist = file2undef[filename]
elist.sort()
for ext in elist:
@@ -98,9 +98,9 @@ def printcallee():
else:
tabs = '\t\t'
if not def2file.has_key(ext):
- print '\t' + ext + tabs + ' *undefined'
+ print('\t' + ext + tabs + ' *undefined')
else:
- print '\t' + ext + tabs + flat(def2file[ext])
+ print('\t' + ext + tabs + flat(def2file[ext]))
# Print for each module the names of the other modules that use it.
#
@@ -114,14 +114,14 @@ def printcaller():
callers = callers + undef2file[label]
if callers:
callers.sort()
- print filename + ':'
+ print(filename + ':')
lastfn = ''
for fn in callers:
if fn <> lastfn:
- print '\t' + fn
+ print('\t' + fn)
lastfn = fn
else:
- print filename + ': unused'
+ print(filename + ': unused')
# Print undefined names and where they are used.
#
@@ -134,11 +134,11 @@ def printundef():
elist = undefs.keys()
elist.sort()
for ext in elist:
- print ext + ':'
+ print(ext + ':')
flist = undefs[ext]
flist.sort()
for filename in flist:
- print '\t' + filename
+ print('\t' + filename)
# Print warning messages about names defined in more than one file.
#
@@ -149,8 +149,8 @@ def warndups():
names.sort()
for name in names:
if len(def2file[name]) > 1:
- print 'warning:', name, 'multiply defined:',
- print flat(def2file[name])
+ print('warning:', name, 'multiply defined:', end=' ')
+ print(flat(def2file[name]))
sys.stdout = savestdout
# Main program
@@ -160,14 +160,14 @@ def main():
optlist, args = getopt.getopt(sys.argv[1:], 'cdu')
except getopt.error:
sys.stdout = sys.stderr
- print 'Usage:', os.path.basename(sys.argv[0]),
- print '[-cdu] [file] ...'
- print '-c: print callers per objectfile'
- print '-d: print callees per objectfile'
- print '-u: print usage of undefined symbols'
- print 'If none of -cdu is specified, all are assumed.'
- print 'Use "nm -o" to generate the input (on IRIX: "nm -Bo"),'
- print 'e.g.: nm -o /lib/libc.a | objgraph'
+ print('Usage:', os.path.basename(sys.argv[0]), end=' ')
+ print('[-cdu] [file] ...')
+ print('-c: print callers per objectfile')
+ print('-d: print callees per objectfile')
+ print('-u: print usage of undefined symbols')
+ print('If none of -cdu is specified, all are assumed.')
+ print('Use "nm -o" to generate the input (on IRIX: "nm -Bo"),')
+ print('e.g.: nm -o /lib/libc.a | objgraph')
return 1
optu = optc = optd = 0
for opt, void in optlist:
@@ -192,15 +192,15 @@ def main():
more = (optu + optc + optd > 1)
if optd:
if more:
- print '---------------All callees------------------'
+ print('---------------All callees------------------')
printcallee()
if optu:
if more:
- print '---------------Undefined callees------------'
+ print('---------------Undefined callees------------')
printundef()
if optc:
if more:
- print '---------------All Callers------------------'
+ print('---------------All Callers------------------')
printcaller()
return 0