diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-03 06:25:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-10-03 06:25:00 +0200 |
commit | d4ed069896a9d49eb33966a0f871e39b5c24da8a (patch) | |
tree | 1c923e288e1641b8a08a71891e3ee5ea1e4dfde5 /engine/SCons/Platform/__init__.py | |
parent | 3765e33b76c51c81dd7bbbfacab0c4e76a1713cb (diff) | |
parent | 13e92f02338ad8d28d58fcd7c9f46d0d5e970e54 (diff) |
Merge branch 'release/3.0.0-1'3.0.0-1
Diffstat (limited to 'engine/SCons/Platform/__init__.py')
-rw-r--r-- | engine/SCons/Platform/__init__.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py index c95f291..61a4010 100644 --- a/engine/SCons/Platform/__init__.py +++ b/engine/SCons/Platform/__init__.py @@ -20,8 +20,8 @@ their own platform definition. """ # -# Copyright (c) 2001 - 2016 The SCons Foundation -# +# Copyright (c) 2001 - 2017 The SCons Foundation +# # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including @@ -41,8 +41,9 @@ their own platform definition. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import print_function -__revision__ = "src/engine/SCons/Platform/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" +__revision__ = "src/engine/SCons/Platform/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" import SCons.compat @@ -55,6 +56,7 @@ import SCons.Errors import SCons.Subst import SCons.Tool + def platform_default(): """Return the platform string for our execution environment. @@ -130,7 +132,7 @@ class PlatformSpec(object): def __str__(self): return self.name - + class TempFileMunge(object): """A callable class. You can set an Environment variable to this, then call it with a string argument, then it will perform temporary @@ -183,9 +185,9 @@ class TempFileMunge(object): node = target[0] if SCons.Util.is_List(target) else target cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \ if node is not None else None - if cmdlist is not None : + if cmdlist is not None : return cmdlist - + # We do a normpath because mktemp() has what appears to be # a bug in Windows that will use a forward slash as a path # delimiter. Windows's link mistakes that for a command line @@ -215,7 +217,7 @@ class TempFileMunge(object): prefix = '@' args = list(map(SCons.Subst.quote_spaces, cmd[1:])) - os.write(fd, " ".join(args) + "\n") + os.write(fd, bytearray(" ".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 @@ -233,14 +235,14 @@ class TempFileMunge(object): # purity get in the way of just being helpful, so we'll # reach into SCons.Action directly. if SCons.Action.print_actions: - cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target, + cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target, source) if self.cmdstr is not None else '' # Print our message only if XXXCOMSTR returns an empty string if len(cmdstr) == 0 : print("Using tempfile "+native_tmp+" for command line:\n"+ str(cmd[0]) + " " + " ".join(args)) - - # Store the temporary file command list into the target Node.attributes + + # Store the temporary file command list into the target Node.attributes # to avoid creating two temporary files one for print and one for execute. cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ] if node is not None: @@ -249,7 +251,8 @@ class TempFileMunge(object): except AttributeError: pass return cmdlist - + + def Platform(name = platform_default()): """Select a canned Platform specification. """ |