summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-01-22 06:06:09 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-01-22 06:06:09 (GMT)
commit0648458b848add652247fceff38422dbb61a63f3 (patch)
tree120f0275a98317771697894d7099803e5766f975 /Lib/test/test_subprocess.py
parent08c1278ab8d49f3b51a984c08cd4f8efe0fc6440 (diff)
parent886455cc4eddbe63a81d775f9b821d5a39d79d8f (diff)
downloadcpython-0648458b848add652247fceff38422dbb61a63f3.zip
cpython-0648458b848add652247fceff38422dbb61a63f3.tar.gz
cpython-0648458b848add652247fceff38422dbb61a63f3.tar.bz2
Fix a unittest error seen on NetBSD 5.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index d508b8f..f2cdc33 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1370,8 +1370,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()