summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Featherstone <andrew.featherstone@cantab.net>2014-07-29 21:05:47 (GMT)
committerAndrew Featherstone <andrew.featherstone@cantab.net>2014-07-29 21:05:47 (GMT)
commit28a2ad02e39ea773ae56aee9c3f855261303ebfe (patch)
treee52acdd54f85bffb4bd6b68e7521634d8faf28c5 /src
parentbfb98081c448458cd05a7870eab45e654eac0a92 (diff)
downloadSCons-28a2ad02e39ea773ae56aee9c3f855261303ebfe.zip
SCons-28a2ad02e39ea773ae56aee9c3f855261303ebfe.tar.gz
SCons-28a2ad02e39ea773ae56aee9c3f855261303ebfe.tar.bz2
Corrects handling of appending dictionaries to CPPDEFINES. Amended a test case to demonstrate the issue.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Environment.py35
1 files changed, 31 insertions, 4 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index d178f49..6c665df 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -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,14 @@ 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
+ #dk = dk.items()
if SCons.Util.is_String(val):
if val in dk:
val = []