>From e7e2f0b8962b8739d5c1b3b5d16b7fcf67e62f75 Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Mon, 8 Dec 2014 12:51:27 -0500
Subject: [PATCH 4/6] Prevent a backtrace when a subprocess is not found

Trap OSError is the kill does not find the subprocess.
This may happen if the subprocess fails early and terminates on its own.

Signed-off-by: Simo Sorce <simo@redhat.com>
---
 proxy/tests/runtests.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/proxy/tests/runtests.py b/proxy/tests/runtests.py
index a941064980441754ae7df047eecb9a2a7550a081..7cceb2f1dd888dd054e5974ba24dbceef6698d66 100755
--- a/proxy/tests/runtests.py
+++ b/proxy/tests/runtests.py
@@ -355,13 +355,19 @@ def run_basic_test(testdir, logfile, env):
     p1.wait()
     if p1.returncode != 0:
         print >> sys.stderr, "FAILED: Init test"
-        os.killpg(p2.pid, signal.SIGTERM)
+        try:
+            os.killpg(p2.pid, signal.SIGTERM)
+        except OSError:
+            pass
     else:
         print >> sys.stderr, "SUCCESS: Init test"
     p2.wait()
     if p2.returncode != 0:
         print >> sys.stderr, "FAILED: Accept test"
-        os.killpg(p1.pid, signal.SIGTERM)
+        try:
+            os.killpg(p1.pid, signal.SIGTERM)
+        except OSError:
+            pass
     else:
         print >> sys.stderr, "SUCCESS: Accept test"
 
-- 
2.1.0

