diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-08-25 15:11:37 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-08-25 15:11:37 +0200 |
commit | 765fbac29295fb4e462c480d09dbdb2f9718a845 (patch) | |
tree | 73104b2debe81c91a5ac638a5b90fd6acbfb3918 /engine/SCons/Environment.py | |
parent | 8bf6d55f69eb30ba1c0c6a798e81c2c67a507342 (diff) |
Imported Upstream version 2.3.3upstream/2.3.3
Diffstat (limited to 'engine/SCons/Environment.py')
-rw-r--r-- | engine/SCons/Environment.py | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/engine/SCons/Environment.py b/engine/SCons/Environment.py index 467007c..ffc9740 100644 --- a/engine/SCons/Environment.py +++ b/engine/SCons/Environment.py @@ -31,7 +31,7 @@ Environment # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Environment.py 2014/07/05 09:42:21 garyo" +__revision__ = "src/engine/SCons/Environment.py 2014/08/24 12:12:31 garyo" import copy @@ -1206,7 +1206,13 @@ class Base(SubstitutionEnvironment): # based on what we think the value looks like. if SCons.Util.is_List(val): if key == 'CPPDEFINES': - orig = orig.items() + tmp = [] + for (k, v) in orig.iteritems(): + if v is not None: + tmp.append((k, v)) + else: + tmp.append((k,)) + orig = tmp orig += val self._dict[key] = orig else: @@ -1286,8 +1292,15 @@ class Base(SubstitutionEnvironment): else: tmp.append((i,)) val = tmp + # Construct a list of (key, value) tuples. if SCons.Util.is_Dict(dk): - dk = dk.items() + tmp = [] + for (k, v) in dk.iteritems(): + if v is not None: + tmp.append((k, v)) + else: + tmp.append((k,)) + dk = tmp elif SCons.Util.is_String(dk): dk = [(dk,)] else: @@ -1327,8 +1340,15 @@ class Base(SubstitutionEnvironment): else: tmp.append((i,)) dk = tmp + # Construct a list of (key, value) tuples. if SCons.Util.is_Dict(val): - val = val.items() + tmp = [] + for (k, v) in val.iteritems(): + if v is not None: + tmp.append((k, v)) + else: + tmp.append((k,)) + val = tmp elif SCons.Util.is_String(val): val = [(val,)] if delete_existing: @@ -1351,7 +1371,13 @@ class Base(SubstitutionEnvironment): if SCons.Util.is_String(dk): dk = [dk] elif SCons.Util.is_Dict(dk): - dk = dk.items() + tmp = [] + for (k, v) in dk.iteritems(): + if v is not None: + tmp.append((k, v)) + else: + tmp.append((k,)) + dk = tmp if SCons.Util.is_String(val): if val in dk: val = [] @@ -1378,10 +1404,8 @@ class Base(SubstitutionEnvironment): (like a function). There are no references to any mutable objects in the original Environment. """ - try: - builders = self._dict['BUILDERS'] - except KeyError: - pass + + builders = self._dict.get('BUILDERS', {}) clone = copy.copy(self) # BUILDERS is not safe to do a simple copy |