]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 73917 via svnmerge from
authorGregory P. Smith <greg@mad-scientist.com>
Thu, 13 Aug 2009 18:33:30 +0000 (18:33 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Thu, 13 Aug 2009 18:33:30 +0000 (18:33 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

(the changes that add a select.PIPE_BUF attribute were removed)

This merge fixes issue3392

................
  r73917 | amaury.forgeotdarc | 2009-07-09 15:44:11 -0700 (Thu, 09 Jul 2009) | 12 lines

  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)
  ........
................

Lib/subprocess.py
Lib/test/test_subprocess.py

index 6a863972c3ba533e6b0ca4296b275f79349362da..06454f37fd16bfb5f5578929fd3a9e7bb6ec7b94 100644 (file)
@@ -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():
index f2a396cd10fbb87c7c12e7556492880e916fc14a..265859a21d9065ee2489f09df7109b879c87f531 100644 (file)
@@ -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