diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2010-03-10 14:14:33 +0100 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2010-03-10 14:14:33 +0100 |
commit | df69433d6a185b997f1ec3c0d30768061c5b500f (patch) | |
tree | f976ed6769e1273e04dca843c18d8bf87fc9b976 /src/engine/SCons/compat/_scons_subprocess.py | |
parent | da3aa9be25ad2463a8f27318b914d2322f782a9e (diff) | |
parent | 68e4fe5ac49effe8959bc8532584edf04553c931 (diff) |
Merge commit 'upstream/1.2.0.d20100306'
Diffstat (limited to 'src/engine/SCons/compat/_scons_subprocess.py')
-rw-r--r-- | src/engine/SCons/compat/_scons_subprocess.py | 32 |
1 files changed, 17 insertions, 15 deletions
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 |