def getArchitecture(config):
cmd = commandInBuildEnv(config, ['dpkg-architecture', '-qDEB_HOST_ARCH'])
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- res = p.communicate()[0] # get only stdout
- if p.returncode != 0: raise Exception("Querying dpkg for the architecture failed")
+ 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[0:len(res)-1] # chop of the \n at the end
def writeDependency(f, name, list):