From: Gregory P. Smith Date: Sun, 22 Jan 2012 06:05:10 +0000 (-0800) Subject: Fix a unittest error seen on NetBSD 5. X-Git-Tag: v3.2.3rc1~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=886455cc4eddbe63a81d775f9b821d5a39d79d8f;p=thirdparty%2FPython%2Fcpython.git Fix a unittest error seen on NetBSD 5. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7f423c1f95ff..40d0fb48be82 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()