Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 886455c

Browse files
committed
Fix a unittest error seen on NetBSD 5.
1 parent 4842efc commit 886455c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Lib/test/test_subprocess.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,18 @@ def test_pipe_cloexec_real_tools(self):
12731273

12741274
self.addCleanup(p1.wait)
12751275
self.addCleanup(p2.wait)
1276-
self.addCleanup(p1.terminate)
1277-
self.addCleanup(p2.terminate)
1276+
def kill_p1():
1277+
try:
1278+
p1.terminate()
1279+
except ProcessLookupError:
1280+
pass
1281+
def kill_p2():
1282+
try:
1283+
p2.terminate()
1284+
except ProcessLookupError:
1285+
pass
1286+
self.addCleanup(kill_p1)
1287+
self.addCleanup(kill_p2)
12781288

12791289
p1.stdin.write(data)
12801290
p1.stdin.close()

0 commit comments

Comments
 (0)