]> code.ossystems Code Review - openembedded-core.git/commitdiff
scritpts/tiny/ksize: Cleanup some python2 leftover in ksize.py
authorjan <jan.vermaete@gmail.com>
Thu, 12 Mar 2020 20:44:44 +0000 (21:44 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Mar 2020 23:05:29 +0000 (23:05 +0000)
Although the script was running with Python3, almost no detailed
output was generated.

Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/tiny/ksize.py

index bc11919f4b305de5d8d8cb57451d4903fe6b3729..8316b85cb1e194f5ae72b970aaf11c514960d999 100755 (executable)
@@ -27,7 +27,7 @@ def usage():
 class Sizes:
     def __init__(self, glob):
         self.title = glob
-        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
+        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
         output = p.communicate()[0].splitlines()
         if len(output) > 2:
             sizes = output[-1].split()[0:4]
@@ -49,14 +49,14 @@ class Report:
         path = os.path.dirname(filename)
 
         p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
-                  shell=True, stdout=PIPE, stderr=PIPE)
+                  shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
         glob = ' '.join(p.communicate()[0].splitlines())
         oreport = Report(glob, str(path) + "/*.o")
         oreport.sizes.title = str(path) + "/*.o"
         r.parts.append(oreport)
 
         if subglob:
-            p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
+            p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True)
             for f in p.communicate()[0].splitlines():
                 path = os.path.dirname(f)
                 r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))