projects
/
auto-debuild.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
42fcdf2
)
ensure the pipe is closed when we are done with the subprocess
author
Ralf Jung
<post@ralfj.de>
Sun, 15 Sep 2013 13:22:20 +0000
(15:22 +0200)
committer
Ralf Jung
<post@ralfj.de>
Sun, 15 Sep 2013 13:22:20 +0000
(15:22 +0200)
auto_debuild.py
patch
|
blob
|
history
diff --git
a/auto_debuild.py
b/auto_debuild.py
index a7087985b285161ee58fa607045526e3aad0cde5..bee82caa859df4fc1759e937bc038a1a4fb8136b 100755
(executable)
--- a/
auto_debuild.py
+++ b/
auto_debuild.py
@@
-177,9
+177,9
@@
def commandInBuildEnv(config, command):
def getArchitecture(config):
cmd = commandInBuildEnv(config, ['dpkg-architecture', '-qDEB_HOST_ARCH'])
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):
return res[0:len(res)-1] # chop of the \n at the end
def writeDependency(f, name, list):