diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 09:21:32 +0000 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 09:21:32 +0000 |
commit | 07fc59e19636a4fc97a18b2038f3fe1c72a94000 (patch) | |
tree | 79d4a6239d81b2ccb4752d4f5ca25e0a7d3b4d4b /engine/SCons/Platform/posix.py | |
parent | 7f642861f3946d4241cbd668de258293ba92767a (diff) | |
parent | 340d57481935334465037d97c0db1555b70c0eb1 (diff) |
Merge commit 'upstream/2.0.0'
Diffstat (limited to 'engine/SCons/Platform/posix.py')
-rw-r--r-- | engine/SCons/Platform/posix.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py index 67aef3e..1f19277 100644 --- a/engine/SCons/Platform/posix.py +++ b/engine/SCons/Platform/posix.py @@ -30,12 +30,11 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Platform/posix.py 5023 2010/06/14 22:05:46 scons" import errno import os import os.path -import string import subprocess import sys import select @@ -53,14 +52,14 @@ def escape(arg): slash = '\\' special = '"$()' - arg = string.replace(arg, slash, slash+slash) + arg = arg.replace(slash, slash+slash) for c in special: - arg = string.replace(arg, c, slash+c) + arg = arg.replace(c, slash+c) return '"' + arg + '"' def exec_system(l, env): - stat = os.system(string.join(l)) + stat = os.system(' '.join(l)) if stat & 0xff: return stat | 0x80 return stat >> 8 @@ -90,22 +89,22 @@ def exec_fork(l, env): return stat >> 8 def _get_env_command(sh, escape, cmd, args, env): - s = string.join(args) + s = ' '.join(args) if env: l = ['env', '-'] + \ - map(lambda t, e=escape: e(t[0])+'='+e(t[1]), env.items()) + \ + [escape(t[0])+'='+escape(t[1]) for t in env.items()] + \ [sh, '-c', escape(s)] - s = string.join(l) + s = ' '.join(l) return s def env_spawn(sh, escape, cmd, args, env): return exec_system([_get_env_command( sh, escape, cmd, args, env)], env) def spawnvpe_spawn(sh, escape, cmd, args, env): - return exec_spawnvpe([sh, '-c', string.join(args)], env) + return exec_spawnvpe([sh, '-c', ' '.join(args)], env) def fork_spawn(sh, escape, cmd, args, env): - return exec_fork([sh, '-c', string.join(args)], env) + return exec_fork([sh, '-c', ' '.join(args)], env) def process_cmd_output(cmd_stdout, cmd_stderr, stdout, stderr): stdout_eof = stderr_eof = 0 @@ -131,7 +130,7 @@ def process_cmd_output(cmd_stdout, cmd_stderr, stdout, stderr): raise def exec_popen3(l, env, stdout, stderr): - proc = subprocess.Popen(string.join(l), + proc = subprocess.Popen(' '.join(l), stdout=stdout, stderr=stderr, shell=True) @@ -198,7 +197,7 @@ def piped_env_spawn(sh, escape, cmd, args, env, stdout, stderr): def piped_fork_spawn(sh, escape, cmd, args, env, stdout, stderr): # spawn using fork / exec and providing a pipe for the command's # stdout / stderr stream - return exec_piped_fork([sh, '-c', string.join(args)], + return exec_piped_fork([sh, '-c', ' '.join(args)], env, stdout, stderr) @@ -217,7 +216,7 @@ def generate(env): # os.fork()/os.exec() works better than os.system(). There may just # not be a default that works best for all users. - if os.__dict__.has_key('spawnvpe'): + if 'spawnvpe' in os.__dict__: spawn = spawnvpe_spawn elif env.Detect('env'): spawn = env_spawn @@ -229,7 +228,7 @@ def generate(env): else: pspawn = piped_fork_spawn - if not env.has_key('ENV'): + if 'ENV' not in env: env['ENV'] = {} env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin' env['OBJPREFIX'] = '' |