diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-07-09 22:44:11 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-07-09 22:44:11 (GMT) |
commit | ace3102131b29081119050dff4e229a58a487976 (patch) | |
tree | e500a0daf5fc247676d427033571f49d7d556e6f /Lib | |
parent | 414c91f7e4917657806e6f80ad19cc752907ff2c (diff) | |
download | cpython-ace3102131b29081119050dff4e229a58a487976.zip cpython-ace3102131b29081119050dff4e229a58a487976.tar.gz cpython-ace3102131b29081119050dff4e229a58a487976.tar.bz2 |
Merged revisions 73916 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73916 | amaury.forgeotdarc | 2009-07-10 00:37:22 +0200 (ven., 10 juil. 2009) | 5 lines
#6416: Fix compilation of the select module on Windows, as well as test_subprocess:
PIPE_BUF is not defined on Windows, and probably has no meaning there.
Anyway the subprocess module uses another way to perform non-blocking reads (with a thread)
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/subprocess.py | 11 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index f7361e1..2e7864c 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -376,6 +376,12 @@ else: import fcntl import pickle + # When select or poll has indicated that the file is writable, + # we can write up to _PIPE_BUF bytes without risk of blocking. + # POSIX defines PIPE_BUF as >= 512. + _PIPE_BUF = getattr(select, 'PIPE_BUF', 512) + + __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput", "getoutput", "check_output", "CalledProcessError"] @@ -384,11 +390,6 @@ try: except: MAXFD = 256 -# When select or poll has indicated that the file is writable, -# we can write up to _PIPE_BUF bytes without risk of blocking. -# POSIX defines PIPE_BUF as >= 512. -_PIPE_BUF = getattr(select, 'PIPE_BUF', 512) - _active = [] def _cleanup(): diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index f2a396c..265859a 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -801,7 +801,7 @@ class CommandTests(unittest.TestCase): unit_tests = [ProcessTestCase, CommandTests] -if subprocess._has_poll: +if getattr(subprocess, '_has_poll', False): class ProcessTestCaseNoPoll(ProcessTestCase): def setUp(self): subprocess._has_poll = False |