diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-06 00:16:57 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-06 00:16:57 (GMT) |
commit | af9a06a77fddfc304ecfcde8464bb995dfcdb25d (patch) | |
tree | 9178280fb299cd7ca473631e9b68ae931532f2eb /Lib/test/test_subprocess.py | |
parent | d77eb9a839c497350d5874183b29df0bb0d14753 (diff) | |
download | cpython-af9a06a77fddfc304ecfcde8464bb995dfcdb25d.zip cpython-af9a06a77fddfc304ecfcde8464bb995dfcdb25d.tar.gz cpython-af9a06a77fddfc304ecfcde8464bb995dfcdb25d.tar.bz2 |
#2777: Apply same recipe for test_terminate and test_kill, i.e. close or redirect fds.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7437e6c..cd378a2 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -673,14 +673,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() |