From 19712e5025e3cf6a33fccd0738f04e018d55025f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 17:48:12 +0200 Subject: New upstream version 3.0.5 --- engine/SCons/Platform/win32.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'engine/SCons/Platform/win32.py') diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py index 60935ca..756f6d6 100644 --- a/engine/SCons/Platform/win32.py +++ b/engine/SCons/Platform/win32.py @@ -8,7 +8,7 @@ selection method. """ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/win32.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/win32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path @@ -39,8 +39,14 @@ import tempfile from SCons.Platform.posix import exitvalmap from SCons.Platform import TempFileMunge +from SCons.Platform.virtualenv import ImportVirtualenv +from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv import SCons.Util +CHOCO_DEFAULT_PATH = [ + r'C:\ProgramData\chocolatey\bin' +] + try: import msvcrt import win32api @@ -80,16 +86,8 @@ else: win32con.HANDLE_FLAG_INHERIT, 0) file = _scons_file else: - import io - for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair', - 'BufferedRandom', 'TextIOWrapper']: - _builtin_file = getattr(io, io_class) - class _scons_file(_builtin_file): - def __init__(self, *args, **kw): - _builtin_file.__init__(self, *args, **kw) - win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()), - win32con.HANDLE_FLAG_INHERIT, 0) - setattr(io, io_class, _scons_file) + # No longer needed for python 3.4 and above. Files are opened non sharable + pass @@ -132,7 +130,7 @@ try: # Without this, python can randomly crash while using -jN. # See the python bug at http://bugs.python.org/issue6476 # and SCons issue at - # http://scons.tigris.org/issues/show_bug.cgi?id=2449 + # https://github.com/SCons/scons/issues/2449 def spawnve(mode, file, args, env): spawn_lock.acquire() try: @@ -200,11 +198,11 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): except OSError as e: # catch any error try: - ret = exitvalmap[e[0]] + ret = exitvalmap[e.errno] except KeyError: - sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e[0], cmd, e[1])) + sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e.errno, cmd, e.strerror)) if stderr is not None: - stderr.write("scons: %s: %s\n" % (cmd, e[1])) + stderr.write("scons: %s: %s\n" % (cmd, e.strerror)) # copy child output from tempfiles to our streams # and do clean up stuff if stdout is not None and stdoutRedirected == 0: @@ -436,7 +434,7 @@ def generate(env): if v: env['ENV']['COMSPEC'] = v - env.AppendENVPath('PATH', get_system_root() + '\System32') + env.AppendENVPath('PATH', get_system_root() + '\\System32') env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD' env['OBJPREFIX'] = '' @@ -462,6 +460,9 @@ def generate(env): env['HOST_OS'] = 'win32' env['HOST_ARCH'] = get_architecture().arch + if enable_virtualenv and not ignore_virtualenv: + ImportVirtualenv(env) + # Local Variables: # tab-width:4 -- cgit v1.2.3