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
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 @@
# 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()