diff options
author | Stefan Zimmermann <zimmermann.code@gmail.com> | 2013-12-27 09:51:19 (GMT) |
---|---|---|
committer | Stefan Zimmermann <zimmermann.code@gmail.com> | 2013-12-27 09:51:19 (GMT) |
commit | 808610957042c630d19c7f7b0fd9b87b81f9de2e (patch) | |
tree | 42c1628d9fa039ef38d0e85c697de8102d3f19bf /src/engine/SCons | |
parent | b5d204ffae80f78083c34b0ba4c105791d57c084 (diff) | |
download | SCons-808610957042c630d19c7f7b0fd9b87b81f9de2e.zip SCons-808610957042c630d19c7f7b0fd9b87b81f9de2e.tar.gz SCons-808610957042c630d19c7f7b0fd9b87b81f9de2e.tar.bz2 |
Environment.py: __cmp__ to __eq__. list(*.keys()) for item deletion loops.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Environment.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index b5bd620..7a369a9 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -127,7 +127,7 @@ future_reserved_construction_var_names = [ def copy_non_reserved_keywords(dict): result = semi_deepcopy(dict) - for k in result.keys(): + for k in list(result.keys()): if k in reserved_construction_var_names: msg = "Ignoring attempt to set reserved variable `$%s'" SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k) @@ -398,8 +398,8 @@ class SubstitutionEnvironment(object): # gotten better than dict.has_key() in Python 2.5.) self._special_set_keys = list(self._special_set.keys()) - def __cmp__(self, other): - return cmp(self._dict, other._dict) + def __eq__(self, other): + return self._dict == other._dict def __delitem__(self, key): special = self._special_del.get(key) @@ -1768,7 +1768,7 @@ class Base(SubstitutionEnvironment): return os.path.join(dir, new_prefix+name+new_suffix) def SetDefault(self, **kw): - for k in kw.keys(): + for k in list(kw.keys()): if k in self._dict: del kw[k] self.Replace(**kw) |