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

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


http://hg.python.org/cpython/rev/337f68382871
changeset: 74576:337f68382871
parent: 74574:7d4658a8de96
parent: 74575:6b436e31e1de
user: Gregory P. Smith <greg at krypto.org>
date: Sat Jan 21 22:06:09 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
@@ -1370,8 +1370,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

AltStyle によって変換されたページ (->オリジナル) /