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):