From 721781d111089f7cdedb0dd539c121a7206a2071 Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Mon, 2 Sep 2013 16:06:01 +1000 Subject: [PATCH] catch osexceptions where process has already stopped --- turbo_hipster/lib/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/turbo_hipster/lib/utils.py b/turbo_hipster/lib/utils.py index e68675b..bff5206 100644 --- a/turbo_hipster/lib/utils.py +++ b/turbo_hipster/lib/utils.py @@ -175,7 +175,10 @@ def execute_to_log(cmd, logfile, timeout=-1, for fd, descriptor in descriptors.items(): poll_obj.unregister(fd) os.close(fd) - p.kill() + try: + p.kill() + except OSError: + pass logger.info('[script exit code = %d]' % p.returncode)