summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-01-22 06:05:10 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-01-22 06:05:10 (GMT)
commit886455cc4eddbe63a81d775f9b821d5a39d79d8f (patch)
treeec456e765e5c70d925dd3ddad2a1adfa099a8a83 /Lib/test/test_subprocess.py
parent4842efcf972eee8acef0840ecca34a88945a99a7 (diff)
downloadcpython-886455cc4eddbe63a81d775f9b821d5a39d79d8f.zip
cpython-886455cc4eddbe63a81d775f9b821d5a39d79d8f.tar.gz
cpython-886455cc4eddbe63a81d775f9b821d5a39d79d8f.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 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()