From abfa63e92a870bd35fd7c2ac362f509d2d432f2f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 8 Dec 2014 12:51:27 -0500 Subject: 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 --- proxy/tests/runtests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'proxy') diff --git a/proxy/tests/runtests.py b/proxy/tests/runtests.py index a941064..7cceb2f 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" -- cgit