diff options
author | Steven Knight <knight@baldmt.com> | 2002-03-14 02:57:20 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-03-14 02:57:20 (GMT) |
commit | d274d685b3fae62354a7c3deb0622e2edd81b0c7 (patch) | |
tree | 4dac018073b8fb70d35c03c4e4ad17e0b75e5142 /src/engine/SCons/Util.py | |
parent | a441c8d1cc8bf1ed0817b4b1deb9ff2e912bb9f0 (diff) | |
download | SCons-d274d685b3fae62354a7c3deb0622e2edd81b0c7.zip SCons-d274d685b3fae62354a7c3deb0622e2edd81b0c7.tar.gz SCons-d274d685b3fae62354a7c3deb0622e2edd81b0c7.tar.bz2 |
Swap the global and local arguments in scons_subst*() to match the Python convention for exec().
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r-- | src/engine/SCons/Util.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 6806c31..04e7e7d 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -170,7 +170,7 @@ class PathList(UserList.UserList): _cv = re.compile(r'\$([_a-zA-Z]\w*|{[^}]*})') _space_sep = re.compile(r'[\t ]+(?![^{]*})') -def scons_subst_list(strSubst, locals, globals, remove=None): +def scons_subst_list(strSubst, globals, locals, remove=None): """ This function is similar to scons_subst(), but with one important difference. Instead of returning a single @@ -189,12 +189,12 @@ def scons_subst_list(strSubst, locals, globals, remove=None): This is the only way to know where the 'split' between arguments is for executing a command line.""" - def repl(m, locals=locals, globals=globals): + def repl(m, globals=globals, locals=locals): key = m.group(1) if key[:1] == '{' and key[-1:] == '}': key = key[1:-1] try: - e = eval(key, locals, globals) + e = eval(key, globals, locals) if not e: s = '' elif is_List(e): @@ -219,7 +219,7 @@ def scons_subst_list(strSubst, locals, globals, remove=None): return map(lambda x: filter(lambda y: y, string.split(x, '\0')), listLines) -def scons_subst(strSubst, locals, globals, remove=None): +def scons_subst(strSubst, globals, locals, remove=None): """Recursively interpolates dictionary variables into the specified string, returning the expanded result. Variables are specified by a $ prefix in the string and @@ -229,7 +229,7 @@ def scons_subst(strSubst, locals, globals, remove=None): surrounded by curly braces to separate the name from trailing characters. """ - cmd_list = scons_subst_list(strSubst, locals, globals, remove) + cmd_list = scons_subst_list(strSubst, globals, locals, remove) return string.join(map(string.join, cmd_list), '\n') class VarInterpolator: |