]> granicus.if.org Git - python/commitdiff
Merged revisions 78704 via svnmerge from
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 00:19:38 +0000 (00:19 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 00:19:38 +0000 (00:19 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78704 | florent.xicluna | 2010-03-06 01:16:57 +0100 (sam, 06 mar 2010) | 2 lines

  #2777: Apply same recipe for test_terminate and test_kill, i.e. close or redirect fds.
........

Lib/test/test_subprocess.py

index 24c3bf9635515997c4be35451818d3ea314fc9ee..b5ad6bacaf77223c2d5fd6d203b1dd1b19bf26a1 100644 (file)
@@ -671,14 +671,16 @@ class POSIXProcessTestCase(unittest.TestCase):
         self.assertNotEqual(p.wait(), 0)
 
     def test_kill(self):
-        p = subprocess.Popen([sys.executable, "-c", "input()"])
+        p = subprocess.Popen([sys.executable, "-c", "input()"],
+                             stdin=subprocess.PIPE, close_fds=True)
 
         self.assertIsNone(p.poll())
         p.kill()
         self.assertEqual(p.wait(), -signal.SIGKILL)
 
     def test_terminate(self):
-        p = subprocess.Popen([sys.executable, "-c", "input()"])
+        p = subprocess.Popen([sys.executable, "-c", "input()"],
+                             stdin=subprocess.PIPE, close_fds=True)
 
         self.assertIsNone(p.poll())
         p.terminate()