diff options
Diffstat (limited to 'engine/SCons/Platform')
-rw-r--r-- | engine/SCons/Platform/__init__.py | 17 | ||||
-rw-r--r-- | engine/SCons/Platform/aix.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/cygwin.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/darwin.py | 13 | ||||
-rw-r--r-- | engine/SCons/Platform/hpux.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/irix.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/mingw.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/os2.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/posix.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/sunos.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/virtualenv.py | 2 | ||||
-rw-r--r-- | engine/SCons/Platform/win32.py | 14 |
12 files changed, 30 insertions, 32 deletions
diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py index e1cc941..8da1e9d 100644 --- a/engine/SCons/Platform/__init__.py +++ b/engine/SCons/Platform/__init__.py @@ -43,11 +43,11 @@ their own platform definition. # from __future__ import print_function -__revision__ = "src/engine/SCons/Platform/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat -import imp +import importlib import os import sys import tempfile @@ -101,13 +101,8 @@ def platform_module(name = platform_default()): eval(full_name) else: try: - file, path, desc = imp.find_module(name, - sys.modules['SCons.Platform'].__path__) - try: - mod = imp.load_module(full_name, file, path, desc) - finally: - if file: - file.close() + # the specific platform module is a relative import + mod = importlib.import_module("." + name, __name__) except ImportError: try: import zipimport @@ -231,8 +226,10 @@ class TempFileMunge(object): prefix = '@' args = list(map(SCons.Subst.quote_spaces, cmd[1:])) - os.write(fd, bytearray(" ".join(args) + "\n",'utf-8')) + join_char = env.get('TEMPFILEARGJOIN',' ') + os.write(fd, bytearray(join_char.join(args) + "\n",'utf-8')) os.close(fd) + # XXX Using the SCons.Action.print_actions value directly # like this is bogus, but expedient. This class should # really be rewritten as an Action that defines the diff --git a/engine/SCons/Platform/aix.py b/engine/SCons/Platform/aix.py index 7faddd9..70fbb35 100644 --- a/engine/SCons/Platform/aix.py +++ b/engine/SCons/Platform/aix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/aix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/aix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import subprocess diff --git a/engine/SCons/Platform/cygwin.py b/engine/SCons/Platform/cygwin.py index 434d125..70b6443 100644 --- a/engine/SCons/Platform/cygwin.py +++ b/engine/SCons/Platform/cygwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/cygwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/cygwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys diff --git a/engine/SCons/Platform/darwin.py b/engine/SCons/Platform/darwin.py index 7f4b468..d5861d9 100644 --- a/engine/SCons/Platform/darwin.py +++ b/engine/SCons/Platform/darwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/darwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/darwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix import os @@ -56,12 +56,11 @@ def generate(env): for file in filelist: if os.path.isfile(file): - f = open(file, 'r') - lines = f.readlines() - for line in lines: - if line: - env.AppendENVPath('PATHOSX', line.strip('\n')) - f.close() + with open(file, 'r') as f: + lines = f.readlines() + for line in lines: + if line: + env.AppendENVPath('PATHOSX', line.strip('\n')) # Not sure why this wasn't the case all along? if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False): diff --git a/engine/SCons/Platform/hpux.py b/engine/SCons/Platform/hpux.py index cc97d39..6867212 100644 --- a/engine/SCons/Platform/hpux.py +++ b/engine/SCons/Platform/hpux.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/hpux.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/hpux.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/irix.py b/engine/SCons/Platform/irix.py index 5df080a..a382e71 100644 --- a/engine/SCons/Platform/irix.py +++ b/engine/SCons/Platform/irix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/irix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/irix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/mingw.py b/engine/SCons/Platform/mingw.py index f3f7e44..c03c9c8 100644 --- a/engine/SCons/Platform/mingw.py +++ b/engine/SCons/Platform/mingw.py @@ -27,7 +27,7 @@ Platform-specific initialization for the MinGW system. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/mingw.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/mingw.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys diff --git a/engine/SCons/Platform/os2.py b/engine/SCons/Platform/os2.py index a680f94..ebabe3d 100644 --- a/engine/SCons/Platform/os2.py +++ b/engine/SCons/Platform/os2.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/os2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/os2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import win32 def generate(env): diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py index aa43f51..780c764 100644 --- a/engine/SCons/Platform/posix.py +++ b/engine/SCons/Platform/posix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/posix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import errno import os diff --git a/engine/SCons/Platform/sunos.py b/engine/SCons/Platform/sunos.py index 2ec4c99..6aa54aa 100644 --- a/engine/SCons/Platform/sunos.py +++ b/engine/SCons/Platform/sunos.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/sunos.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/sunos.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/virtualenv.py b/engine/SCons/Platform/virtualenv.py index 4cfb6e1..9fb3e45 100644 --- a/engine/SCons/Platform/virtualenv.py +++ b/engine/SCons/Platform/virtualenv.py @@ -26,7 +26,7 @@ Support for virtualenv. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/virtualenv.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/virtualenv.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import sys diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py index 756f6d6..ea567a2 100644 --- a/engine/SCons/Platform/win32.py +++ b/engine/SCons/Platform/win32.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/win32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path @@ -193,7 +193,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # actually do the spawn try: - args = [sh, '/C', escape(' '.join(args)) ] + args = [sh, '/C', escape(' '.join(args))] ret = spawnve(os.P_WAIT, sh, args, env) except OSError as e: # catch any error @@ -207,15 +207,17 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # and do clean up stuff if stdout is not None and stdoutRedirected == 0: try: - stdout.write(open( tmpFileStdout, "r" ).read()) - os.remove( tmpFileStdout ) + with open(tmpFileStdout, "r" ) as tmp: + stdout.write(tmp.read()) + os.remove(tmpFileStdout) except (IOError, OSError): pass if stderr is not None and stderrRedirected == 0: try: - stderr.write(open( tmpFileStderr, "r" ).read()) - os.remove( tmpFileStderr ) + with open(tmpFileStderr, "r" ) as tmp: + stderr.write(tmp.read()) + os.remove(tmpFileStderr) except (IOError, OSError): pass return ret |