From c36195ffb7cf682d2ddd2ba754064c79b2a7fc53 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 20 Sep 2013 15:42:07 +0200 Subject: [PATCH] Use subprocess.check_output --- auto_debuild.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/auto_debuild.py b/auto_debuild.py index a5fb5bc..11935ef 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -177,10 +177,8 @@ def commandInBuildEnv(config, command): def getArchitecture(config): cmd = commandInBuildEnv(config, ['dpkg-architecture', '-qDEB_HOST_ARCH']) - with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: - res = p.communicate()[0] # get only stdout - if p.returncode != 0: raise Exception("Querying dpkg for the architecture failed") - return res.decode('utf-8').strip('\n') # chop of the \n at the end + output = subprocess.check_output(cmd) + return output.decode('utf-8').strip('\n') # chop of the \n at the end def writeDependency(f, name, list): if len(list): -- 2.30.2