]> code.ossystems Code Review - openembedded-core.git/commitdiff
package: correct subprocess.Popen.communicate() return values
authorVladimir Zapolskiy <vz@mleia.com>
Sat, 6 Aug 2016 01:43:29 +0000 (04:43 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 09:45:32 +0000 (10:45 +0100)
This is a non-functional change, which intends to correct element
names of a tuple returned by Popen.communicate().

Both in python2 and python3 subprocess.Popen.communicate() method
returns a tuple (stdoutdata, stderrdata), thus old assignments and
collateral comments are incorrect from human's point of view, however
formally there is no error in the code.

The change is desired to have to avoid copy-paste errors in future.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/package.bbclass

index 6aed4cac702aefb8811aae09b29729ac012aebb5..d0b2db6ae87b0a18181ab3e1836879c18b2d344e 100644 (file)
@@ -1579,19 +1579,19 @@ python package_do_shlibs() {
         if file.endswith('.dylib') or file.endswith('.so'):
             rpath = []
             p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file],stdout=sub.PIPE,stderr=sub.PIPE)
-            err, out = p.communicate()
-            # If returned successfully, process stderr for results
+            out, err = p.communicate()
+            # If returned successfully, process stdout for results
             if p.returncode == 0:
-                for l in err.split("\n"):
+                for l in out.split("\n"):
                     l = l.strip()
                     if l.startswith('path '):
                         rpath.append(l.split()[1])
 
         p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file],stdout=sub.PIPE,stderr=sub.PIPE)
-        err, out = p.communicate()
-        # If returned successfully, process stderr for results
+        out, err = p.communicate()
+        # If returned successfully, process stdout for results
         if p.returncode == 0:
-            for l in err.split("\n"):
+            for l in out.split("\n"):
                 l = l.strip()
                 if not l or l.endswith(":"):
                     continue