From 886455cc4eddbe63a81d775f9b821d5a39d79d8f Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sat, 21 Jan 2012 22:05:10 -0800 Subject: Fix a unittest error seen on NetBSD 5. --- Lib/test/test_subprocess.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7f423c1..40d0fb4 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1273,8 +1273,18 @@ class POSIXProcessTestCase(BaseTestCase): self.addCleanup(p1.wait) self.addCleanup(p2.wait) - self.addCleanup(p1.terminate) - self.addCleanup(p2.terminate) + def kill_p1(): + try: + p1.terminate() + except ProcessLookupError: + pass + def kill_p2(): + try: + p2.terminate() + except ProcessLookupError: + pass + self.addCleanup(kill_p1) + self.addCleanup(kill_p2) p1.stdin.write(data) p1.stdin.close() -- cgit v0.12