diff options
author | Dirk Baechle <dl9obn@darc.de> | 2014-08-06 23:12:21 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2014-08-06 23:12:21 (GMT) |
commit | a64b41ac4e3e506417f465e414b94cb07aed582e (patch) | |
tree | 82f5aa6c1e99166e337a9a3cdf3e1af4cb628682 /src | |
parent | 67f3f8950bb1076382d816e859026018974ee132 (diff) | |
parent | 31b8874144cf5df3b7a7fa296579534a628db8f8 (diff) | |
download | SCons-a64b41ac4e3e506417f465e414b94cb07aed582e.zip SCons-a64b41ac4e3e506417f465e414b94cb07aed582e.tar.gz SCons-a64b41ac4e3e506417f465e414b94cb07aed582e.tar.bz2 |
Merged in ajf58/scons (pull request #160), fixes #2900 (handling of appending dictionaries to CPPDEFINES)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 2 | ||||
-rw-r--r-- | src/engine/SCons/Environment.py | 34 |
2 files changed, 32 insertions, 4 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0ed5237..c8c1fbf 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -12,6 +12,8 @@ RELEASE 2.3.2.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Andrew Featherstone: - Added description of CheckTypeSize method (#1991). + - Fixed handling of CPPDEFINE var in Append() + for several list-dict combinations (#2900). From William Blevins: - Added test for Java derived-source dependency tree generation. diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 7789855..62d6809 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,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 = [] |