From 68e4fe5ac49effe8959bc8532584edf04553c931 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Wed, 10 Mar 2010 14:14:26 +0100 Subject: Imported Upstream version 1.2.0.d20100306 --- src/engine/SCons/compat/__init__.py | 2 +- src/engine/SCons/compat/_scons_UserString.py | 2 +- src/engine/SCons/compat/_scons_hashlib.py | 2 +- src/engine/SCons/compat/_scons_itertools.py | 2 +- src/engine/SCons/compat/_scons_platform.py | 2 +- src/engine/SCons/compat/_scons_subprocess.py | 32 +++++++++++++++------------- src/engine/SCons/compat/builtins.py | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) (limited to 'src/engine/SCons/compat') diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index 1d321d5..87c75e4 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -60,7 +60,7 @@ function defined below loads the module as the "real" name (without the rest of our code will find our pre-loaded compatibility module. """ -__revision__ = "src/engine/SCons/compat/__init__.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/__init__.py 4691 2010/03/06 16:22:36 bdbaddog" def import_as(module, name): """ diff --git a/src/engine/SCons/compat/_scons_UserString.py b/src/engine/SCons/compat/_scons_UserString.py index 2f4adde..9c96bdc 100644 --- a/src/engine/SCons/compat/_scons_UserString.py +++ b/src/engine/SCons/compat/_scons_UserString.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/compat/_scons_UserString.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/_scons_UserString.py 4691 2010/03/06 16:22:36 bdbaddog" __doc__ = """ A user-defined wrapper around string objects diff --git a/src/engine/SCons/compat/_scons_hashlib.py b/src/engine/SCons/compat/_scons_hashlib.py index 6f62388..d00f177 100644 --- a/src/engine/SCons/compat/_scons_hashlib.py +++ b/src/engine/SCons/compat/_scons_hashlib.py @@ -31,7 +31,7 @@ purposes, anyway). In fact, this module will raise an ImportError if the underlying md5 module isn't available. """ -__revision__ = "src/engine/SCons/compat/_scons_hashlib.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/_scons_hashlib.py 4691 2010/03/06 16:22:36 bdbaddog" import md5 import string diff --git a/src/engine/SCons/compat/_scons_itertools.py b/src/engine/SCons/compat/_scons_itertools.py index d715cf6..4c66894 100644 --- a/src/engine/SCons/compat/_scons_itertools.py +++ b/src/engine/SCons/compat/_scons_itertools.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/compat/_scons_itertools.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/_scons_itertools.py 4691 2010/03/06 16:22:36 bdbaddog" __doc__ = """ Implementations of itertools functions for Python versions that don't diff --git a/src/engine/SCons/compat/_scons_platform.py b/src/engine/SCons/compat/_scons_platform.py index 70bf4a6..8af807e 100644 --- a/src/engine/SCons/compat/_scons_platform.py +++ b/src/engine/SCons/compat/_scons_platform.py @@ -29,7 +29,7 @@ functionality. It only wraps the portions of platform functionality used by SCons. """ -__revision__ = "src/engine/SCons/compat/_scons_platform.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/_scons_platform.py 4691 2010/03/06 16:22:36 bdbaddog" ### Portable uname() interface diff --git a/src/engine/SCons/compat/_scons_subprocess.py b/src/engine/SCons/compat/_scons_subprocess.py index 4968825..ccd403a 100644 --- a/src/engine/SCons/compat/_scons_subprocess.py +++ b/src/engine/SCons/compat/_scons_subprocess.py @@ -381,7 +381,21 @@ if mswindows: # can't import it. pass import msvcrt - if 0: # <-- change this to use pywin32 instead of the _subprocess driver + try: + # Try to get _subprocess + from _subprocess import * + class STARTUPINFO: + dwFlags = 0 + hStdInput = None + hStdOutput = None + hStdError = None + wShowWindow = 0 + class pywintypes: + error = IOError + except ImportError: + # If not there, then drop back to requiring pywin32 + # TODO: Should this be wrapped in try as well? To notify user to install + # pywin32 ? With URL to it? import pywintypes from win32api import GetStdHandle, STD_INPUT_HANDLE, \ STD_OUTPUT_HANDLE, STD_ERROR_HANDLE @@ -393,20 +407,8 @@ if mswindows: GetExitCodeProcess, STARTF_USESTDHANDLES, \ STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0 - else: - # SCons: don't die on Python versions that don't have _subprocess. - try: - from _subprocess import * - except ImportError: - pass - class STARTUPINFO: - dwFlags = 0 - hStdInput = None - hStdOutput = None - hStdError = None - wShowWindow = 0 - class pywintypes: - error = IOError + + else: import select import errno diff --git a/src/engine/SCons/compat/builtins.py b/src/engine/SCons/compat/builtins.py index cc0bc46..2c1fa32 100644 --- a/src/engine/SCons/compat/builtins.py +++ b/src/engine/SCons/compat/builtins.py @@ -55,7 +55,7 @@ the FUNCTIONS or DATA output, that means those names are already built in to this version of Python and we don't need to add them from this module. """ -__revision__ = "src/engine/SCons/compat/builtins.py 4629 2010/01/17 22:23:21 scons" +__revision__ = "src/engine/SCons/compat/builtins.py 4691 2010/03/06 16:22:36 bdbaddog" import __builtin__ -- cgit v1.2.3