summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Subst.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-12-30 19:59:43 (GMT)
committerSteven Knight <knight@baldmt.com>2008-12-30 19:59:43 (GMT)
commit312f88d4f0daa0aa8ccdad202c76b7e297b605cd (patch)
treecbc1682df3b74751e0126f55fe16238135e07b86 /src/engine/SCons/Subst.py
parent7b36529d703b12ee4f16c3aa5bd34a002235371d (diff)
downloadSCons-312f88d4f0daa0aa8ccdad202c76b7e297b605cd.zip
SCons-312f88d4f0daa0aa8ccdad202c76b7e297b605cd.tar.gz
SCons-312f88d4f0daa0aa8ccdad202c76b7e297b605cd.tar.bz2
Issue 1417: Fix use of attributes (${SOURCES.windows}, e.g.) with null
lists of targets and sources.
Diffstat (limited to 'src/engine/SCons/Subst.py')
-rw-r--r--src/engine/SCons/Subst.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py
index 752bbff..fc9d7d9 100644
--- a/src/engine/SCons/Subst.py
+++ b/src/engine/SCons/Subst.py
@@ -253,6 +253,12 @@ class Target_or_Source:
return repr(nl[0])
return ''
+class NullNodeList(SCons.Util.NullSeq):
+ def __call__(self, *args, **kwargs): return ''
+ def __str__(self): return ''
+
+NullNodesList = NullNodeList()
+
def subst_dict(target, source):
"""Create a dictionary for substitution of special
construction variables.
@@ -280,8 +286,8 @@ def subst_dict(target, source):
dict['TARGETS'] = Targets_or_Sources(tnl)
dict['TARGET'] = Target_or_Source(tnl)
else:
- dict['TARGETS'] = None
- dict['TARGET'] = None
+ dict['TARGETS'] = NullNodesList
+ dict['TARGET'] = NullNodesList
if source:
def get_src_subst_proxy(node):
@@ -299,8 +305,8 @@ def subst_dict(target, source):
dict['SOURCES'] = Targets_or_Sources(snl)
dict['SOURCE'] = Target_or_Source(snl)
else:
- dict['SOURCES'] = None
- dict['SOURCE'] = None
+ dict['SOURCES'] = NullNodesList
+ dict['SOURCE'] = NullNodesList
return dict