We aim to support Python 3.4+ whereas subprocess.run() was added
in Python 3.5.
Replace subprocess.run() with subprocess.check_output().

Signed-off-by: Joshua Lock <[email protected]>
---
 scripts/runqemu | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 0a56c60..27108ee 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -858,10 +858,11 @@ class BaseConfig(object):
             cmd = 'bitbake -e'
 
         logger.info('Running %s...' % cmd)
-        proc = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)
-        if proc.returncode != 0:
-            logger.warn("Couldn't run 'bitbake -e' to gather environment 
information")
-        self.bitbake_e = proc.stdout.decode('utf-8')
+        try:
+            self.bitbake_e = subprocess.check_output(cmd, 
shell=True).decode('utf-8')
+        except subprocess.CalledProcessError as err:
+            self.bitbake_e = ''
+            logger.warn("Couldn't run 'bitbake -e' to gather environment 
information/\n%s" % err.output.decode('utf-8'))
 
 def main():
     if len(sys.argv) == 1 or "help" in sys.argv:
-- 
2.7.4

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to