summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2014-04-08 17:12:02 +1000
committerJoshua Hesketh <josh@nitrotech.org>2014-04-08 17:12:06 +1000
commit6ad492cf575b38dffe4283e3314499b7518055fe (patch)
tree1b0831923423220eaf164c07a676e30ee3b33dcf
parente185911f3459416b98b7efbdb9c618544547ecee (diff)
downloadturbo-hipster-6ad492cf575b38dffe4283e3314499b7518055fe.tar.gz
Stop trying to close the open process
execute_to_log tries to be good and clean up the open file descriptors. However it would also try and close the subprocess which cleans itself up. Avoid "IOError: [Errno 9] Bad file descriptor" by skipping over the subprocess file descriptor. Change-Id: Iae7d21bbacd07f487fb56592ea12cbd4edb06ca4
-rw-r--r--turbo_hipster/lib/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/turbo_hipster/lib/utils.py b/turbo_hipster/lib/utils.py
index fa295af..f0603af 100644
--- a/turbo_hipster/lib/utils.py
+++ b/turbo_hipster/lib/utils.py
@@ -186,6 +186,9 @@ def execute_to_log(cmd, logfile, timeout=-1,
# Clean up
for fd, descriptor in descriptors.items():
poll_obj.unregister(fd)
+ if fd == p.stdout.fileno():
+ # Don't try and close the process, it'll clean itself up
+ continue
os.close(fd)
try:
p.kill()