summaryrefslogtreecommitdiffstats
path: root/utils/analysis
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-09 10:36:06 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-09 14:39:27 +0000
commitdcdf2713f610cb3cfaa615ab9b8d4b9412e7a8b6 (patch)
treee0b581aa203158e9dab01398f38a0b1a82adc6ee /utils/analysis
parent278a76b3a6dbf658bd0d3ad67ad7f15d8b8fa32a (diff)
downloadrockbox-dcdf2713f610cb3cfaa615ab9b8d4b9412e7a8b6.tar.gz
rockbox-dcdf2713f610cb3cfaa615ab9b8d4b9412e7a8b6.tar.bz2
rockbox-dcdf2713f610cb3cfaa615ab9b8d4b9412e7a8b6.zip
Python3-related fixes in some of our scripts
Change-Id: I8acbe43e3f27e51159a7a78fcc361476d7406cbb
Diffstat (limited to 'utils/analysis')
-rwxr-xr-xutils/analysis/objdiff.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/utils/analysis/objdiff.py b/utils/analysis/objdiff.py
index dc51441bfa..29f703e52a 100755
--- a/utils/analysis/objdiff.py
+++ b/utils/analysis/objdiff.py
@@ -3,10 +3,10 @@ import sys
from subprocess import Popen, PIPE
if len(sys.argv) != 3:
- print """%s usage:
+ print ("""%s usage:
%s obj1 obj2
Calculate per-symbol and total size differences between obj1 and obj2,
- which may be any files that nm can read""" % ((sys.argv[0],)*2)
+ which may be any files that nm can read""" % ((sys.argv[0],)*2))
sys.exit(2)
obj1 = sys.argv[1]
@@ -16,8 +16,8 @@ def getsyms(obj):
proc = Popen(args=['nm', '-S', '-t', 'd', obj], stdout=PIPE, stderr=PIPE)
out, err = proc.communicate()
if err:
- print "nm reported an error:\n"
- print err
+ print ("nm reported an error:\n")
+ print (err)
sys.exit(1)
d = {}
for l in out.splitlines():
@@ -32,23 +32,23 @@ d1 = getsyms(obj1)
d2 = getsyms(obj2)
l = [(k,v) for k,v in sorted(d1.items()) if k not in d2]
if l:
- print "only in %s" % obj1
- print ''.join(" %6d %s\n" % (v,k) for k,v in l)
+ print ("only in %s" % obj1)
+ print (''.join(" %6d %s\n" % (v,k)) for k,v in l)
diff -= sum(v for k,v in l)
l = [(k,v) for k,v in sorted(d2.items()) if k not in d1]
if l:
- print "only in %s" % obj2
- print ''.join("%6d %s\n" % (v,k) for k,v in l)
+ print ("only in %s" % obj2)
+ print (''.join("%6d %s\n" % (v,k)) for k,v in l)
diff += sum(v for k,v in l)
l = [(k,v,d2[k]) for k,v in sorted(d1.items()) if k in d2 and d2[k] != v]
if l:
- print "different sizes in %s and %s:" %(obj1, obj2)
- print ''.join(" %6d %6d %s\n" % (v1,v2,k) for k,v1,v2 in l)
+ print ("different sizes in %s and %s:" %(obj1, obj2))
+ print (''.join(" %6d %6d %s\n" % (v1,v2,k)) for k,v1,v2 in l)
diff += sum(v2-v1 for k,v1,v2 in l)
if diff:
- print "total size difference: %+d" % diff
+ print ("total size difference: %+d" % diff)
else:
- print "total size difference: 0"
+ print ("total size difference: 0")