[Python-checkins] cpython (3.2): Fix a unittest error seen on NetBSD 5.

gregory.p.smith python-checkins at python.org
Sun Jan 22 07:06:20 CET 2012


http://hg.python.org/cpython/rev/6b436e31e1de
changeset:   74575:6b436e31e1de
branch:      3.2
parent:      74573:754c2eb0a92c
user:        Gregory P. Smith <greg at krypto.org>
date:        Sat Jan 21 22:05:10 2012 -0800
summary:
  Fix a unittest error seen on NetBSD 5.

files:
  Lib/test/test_subprocess.py |  14 ++++++++++++--
  1 files changed, 12 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1273,8 +1273,18 @@
 
         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()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list