diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2009-05-22 05:35:32 (GMT) |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2009-05-22 05:35:32 (GMT) |
commit | 739aa36818131fc4917fa2e13a3af1f23344fcb7 (patch) | |
tree | 0d2449a7785db8e7ed64acb2342d14c54234c74d /Lib/test/test_cmd_line.py | |
parent | 9b6f13ee82ec81a7e88e68094998631559e93f11 (diff) | |
download | cpython-739aa36818131fc4917fa2e13a3af1f23344fcb7.zip cpython-739aa36818131fc4917fa2e13a3af1f23344fcb7.tar.gz cpython-739aa36818131fc4917fa2e13a3af1f23344fcb7.tar.bz2 |
don't use subprocess.call with PIPEs as the child can fill the pipe buf and
deadlock. add a warning to subprocess docs about this, similar to Popen.wait's.
refs http://bugs.jython.org/issue1351
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index efef74f..09945f7 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -2,6 +2,7 @@ # All tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution +import os import test.test_support, unittest import sys import subprocess @@ -29,8 +30,9 @@ class CmdLineTest(unittest.TestCase): def exit_code(self, *args): cmd_line = [sys.executable, '-E'] cmd_line.extend(args) - return subprocess.call(cmd_line, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + with open(os.devnull, 'w') as devnull: + return subprocess.call(cmd_line, stdout=devnull, + stderr=subprocess.STDOUT) def test_directories(self): self.assertNotEqual(self.exit_code('.'), 0) |