summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Defaults.py
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 +0000
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 +0000
commitaf6d7c35464bb75dcabc72094b4bd84154dde50d (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /src/engine/SCons/Defaults.py
parent55ef7fe83e3211be3045f089767ca8e198db1c2c (diff)
downloadscons-af6d7c35464bb75dcabc72094b4bd84154dde50d.tar.gz
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'src/engine/SCons/Defaults.py')
-rw-r--r--src/engine/SCons/Defaults.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 7ce981dd..2f48d0d3 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -41,7 +41,6 @@ import os.path
import errno
import shutil
import stat
-import string
import time
import types
import sys
@@ -88,7 +87,7 @@ def DefaultEnvironment(*args, **kw):
global _default_env
if not _default_env:
import SCons.Util
- _default_env = apply(SCons.Environment.Environment, args, kw)
+ _default_env = SCons.Environment.Environment(*args, **kw)
if SCons.Util.md5:
_default_env.Decider('MD5')
else:
@@ -165,7 +164,7 @@ def get_paths_str(dest):
elem_strs = []
for element in dest:
elem_strs.append('"' + str(element) + '"')
- return '[' + string.join(elem_strs, ', ') + ']'
+ return '[' + ', '.join(elem_strs) + ']'
else:
return '"' + str(dest) + '"'
@@ -315,16 +314,16 @@ def _concat_ixes(prefix, list, suffix, env):
return result
-def _stripixes(prefix, list, suffix, stripprefixes, stripsuffixes, env, c=None):
+def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None):
"""
- This is a wrapper around _concat()/_concat_ixes() that checks for the
- existence of prefixes or suffixes on list elements and strips them
+ This is a wrapper around _concat()/_concat_ixes() that checks for
+ the existence of prefixes or suffixes on list items and strips them
where it finds them. This is used by tools (like the GNU linker)
that need to turn something like 'libfoo.a' into '-lfoo'.
"""
- if not list:
- return list
+ if not itms:
+ return itms
if not callable(c):
env_c = env['_concat']
@@ -337,11 +336,11 @@ def _stripixes(prefix, list, suffix, stripprefixes, stripsuffixes, env, c=None):
else:
c = _concat_ixes
- stripprefixes = map(env.subst, SCons.Util.flatten(stripprefixes))
- stripsuffixes = map(env.subst, SCons.Util.flatten(stripsuffixes))
+ stripprefixes = list(map(env.subst, SCons.Util.flatten(stripprefixes)))
+ stripsuffixes = list(map(env.subst, SCons.Util.flatten(stripsuffixes)))
stripped = []
- for l in SCons.PathList.PathList(list).subst_path(env, None, None):
+ for l in SCons.PathList.PathList(itms).subst_path(env, None, None):
if isinstance(l, SCons.Node.FS.File):
stripped.append(l)
continue
@@ -446,11 +445,11 @@ class Variable_Method_Caller:
frame = sys.exc_info()[2].tb_frame.f_back
variable = self.variable
while frame:
- if frame.f_locals.has_key(variable):
+ if variable in frame.f_locals:
v = frame.f_locals[variable]
if v:
method = getattr(v, self.method)
- return apply(method, args, kw)
+ return method(*args, **kw)
frame = frame.f_back
return None