diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-06 09:54:14 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-06 09:54:14 (GMT) |
commit | aa90db947777d7534eb47f5b3184e87d0901fc63 (patch) | |
tree | fbcc43da58456d1ed60e60365c29f789db172704 /Lib/test | |
parent | b7c20028fe2ebd6cc0f77374dcb30fab732d99ab (diff) | |
download | cpython-aa90db947777d7534eb47f5b3184e87d0901fc63.zip cpython-aa90db947777d7534eb47f5b3184e87d0901fc63.tar.gz cpython-aa90db947777d7534eb47f5b3184e87d0901fc63.tar.bz2 |
#2777: Apply same recipe on win32, i.e. do not inherit file handles.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_subprocess.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index cd378a2..7e96c21 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -769,21 +769,23 @@ class Win32ProcessTestCase(unittest.TestCase): self.assertEqual(rc, 47) def test_send_signal(self): - p = subprocess.Popen([sys.executable, "-c", "input()"]) + # Do not inherit file handles from the parent. + # It should fix failure on some platforms. + p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True) self.assertIs(p.poll(), None) p.send_signal(signal.SIGTERM) self.assertNotEqual(p.wait(), 0) def test_kill(self): - p = subprocess.Popen([sys.executable, "-c", "input()"]) + p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True) self.assertIs(p.poll(), None) p.kill() self.assertNotEqual(p.wait(), 0) def test_terminate(self): - p = subprocess.Popen([sys.executable, "-c", "input()"]) + p = subprocess.Popen([sys.executable, "-c", "input()"], close_fds=True) self.assertIs(p.poll(), None) p.terminate() |