From 0de5191eaec0321118254673e8f8414228668818 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Wed, 10 Mar 2010 13:49:35 +0100 Subject: Imported Upstream version 1.2.0.d20100306 --- engine/SCons/compat/_scons_subprocess.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'engine/SCons/compat/_scons_subprocess.py') diff --git a/engine/SCons/compat/_scons_subprocess.py b/engine/SCons/compat/_scons_subprocess.py index 4968825..ccd403a 100644 --- a/engine/SCons/compat/_scons_subprocess.py +++ b/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 -- cgit v1.2.3