result = _dollar_exps.sub(sub_match, args)
except TypeError:
# If the internal conversion routine doesn't return
- # strings (it could be overridden to return Nodes,
- # for example), then the re module will throw this
+ # strings (it could be overridden to return Nodes, for
+ # example), then the 1.5.2 re module will throw this
# exception. Back off to a slower, general-purpose
# algorithm that works for all data types.
args = _separate_args.findall(args)
try:
result = string.join(result, '')
except TypeError:
- pass
+ if len(result) == 1:
+ result = result[0]
return result
else:
return self.expand(args, lvars)
n1 = MyNode('n1')
env = DummyEnv({'NODE' : n1})
node = scons_subst("$NODE", env, mode=SUBST_RAW, conv=s)
- assert node == [n1], node
+ assert node is n1, node
node = scons_subst("$NODE", env, mode=SUBST_CMD, conv=s)
- assert node == [n1], node
+ assert node is n1, node
node = scons_subst("$NODE", env, mode=SUBST_SIG, conv=s)
- assert node == [n1], node
+ assert node is n1, node
# Test returning a function.
#env = DummyEnv({'FUNCTION' : foo})