diff options
author | Steven Knight <knight@baldmt.com> | 2002-11-13 08:49:30 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-11-13 08:49:30 (GMT) |
commit | 3cd1df2a2faa246a150f9a6e5a29368eab106a30 (patch) | |
tree | 6923adde0391471bd033183fa8f34ae38edcb4ed /src | |
parent | c3f2f406542da875245f96d9505b5bedde0a5de0 (diff) | |
download | SCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.zip SCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.tar.gz SCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.tar.bz2 |
Win32 portability.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Action.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Util.py | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 255f329..8347195 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -175,7 +175,7 @@ elif os.name == 'nt': return 127 else: try: - args = [cmd_interp, '/C', quote(string.join(args)) ] + args = [cmd_interp, '/C', escape_cmd(string.join(args)) ] ret = os.spawnve(os.P_WAIT, cmd_interp, args, env) except OSError, e: ret = exitvalmap[e[0]] diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index adba42a..62772ae 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -204,7 +204,7 @@ def quote_spaces(arg): if ' ' in arg or '\t' in arg: return '"%s"' % arg else: - return arg + return str(arg) # Several functions below deal with Environment variable # substitution. Part of this process involves inserting @@ -290,7 +290,7 @@ class CmdStringHolder: in the string before passing it to the command interpreter.""" self.data = cmd - # Populate flatdata (the ting returned by str()) with the + # Populate flatdata (the thing returned by str()) with the # non-escaped string self.escape(lambda x: x, lambda x: x) @@ -298,6 +298,14 @@ class CmdStringHolder: """Return the string in its current state.""" return self.flatdata + def __len__(self): + """Return the length of the string in its current state.""" + return len(self.flatdata) + + def __getitem__(self, index): + """Return the index'th element of the string in its current state.""" + return self.flatdata[index] + def escape(self, escape_func, quote_func=quote_spaces): """Escape the string with the supplied function. The function is expected to take an arbitrary string, then |