]> granicus.if.org Git - python/commitdiff
#2777: Apply same recipe on win32, i.e. do not inherit file handles.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 09:54:14 +0000 (09:54 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 09:54:14 +0000 (09:54 +0000)
Lib/test/test_subprocess.py

index cd378a231dfa463492e1d5a2caa1ee48a1fa29f3..7e96c214e054ec5fdea2e95589b01d77aed26021 100644 (file)
@@ -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()