- Add internal SCons.Node.FS.{Dir,File}.Entry() methods.
+ - Interpolate the null string if an out-of-range subscript is used
+ for a construction variable.
+
From Damyan Pepper:
- Quote the "Entering directory" message like Make.
key = key[1:-1]
try:
e = eval(key, global_vars, local_vars)
- except NameError:
+ except (IndexError, NameError, TypeError):
return '\0\5'
if callable(e):
# We wait to evaluate callables until the end of everything
key = key[1:-1]
try:
e = eval(key, global_vars, local_vars)
- except NameError:
+ except (IndexError, NameError, TypeError):
return '\0\5'
if callable(e):
e = e(target=target, source=source, env=env,
newcom = scons_subst("$FOO $BAZ $BAR", DummyEnv(glob))
assert newcom == "BAR $FOO BAR", newcom
+ # Test that we don't blow up even if they subscript something
+ # in ways they "can't."
+ glob = { "FOO" : "BAR",
+ "NOTHING" : "" ,
+ "NONE" : None }
+ newcom = scons_subst("${FOO[0]}", DummyEnv(glob))
+ assert newcom == "B", newcom
+ newcom = scons_subst("${FOO[7]}", DummyEnv(glob))
+ assert newcom == "", newcom
+ newcom = scons_subst("${NOTHING[1]}", DummyEnv(glob))
+ assert newcom == "", newcom
+ newcom = scons_subst("${NONE[2]}", DummyEnv(glob))
+ assert newcom == "", newcom
+
def test_splitext(self):
assert splitext('foo') == ('foo','')
assert splitext('foo.bar') == ('foo','.bar')