Subst.py (scons-4.2.0) | : | Subst.py (SCons-4.3.0) | ||
---|---|---|---|---|
skipping to change at line 413 | skipping to change at line 413 | |||
# so it should be tolerable for now. | # so it should be tolerable for now. | |||
lv = lvars.copy() | lv = lvars.copy() | |||
var = key.split('.')[0] | var = key.split('.')[0] | |||
lv[var] = '' | lv[var] = '' | |||
return self.substitute(s, lv) | return self.substitute(s, lv) | |||
elif is_Sequence(s): | elif is_Sequence(s): | |||
def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars) : | def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars) : | |||
return conv(substitute(l, lvars)) | return conv(substitute(l, lvars)) | |||
return list(map(func, s)) | return list(map(func, s)) | |||
elif callable(s): | elif callable(s): | |||
# SCons has the unusual Null class where any __getattr__ call return s it's self, | # SCons has the unusual Null class where any __getattr__ call return s it's self, | |||
# which does not work the signature module, and the Null class retur ns an empty | # which does not work the signature module, and the Null class retur ns an empty | |||
# string if called on, so we make an exception in this condition for Null class | # string if called on, so we make an exception in this condition for Null class | |||
# Also allow callables where the only non default valued args match the expected defaults | # Also allow callables where the only non default valued args match the expected defaults | |||
# this should also allow functools.partial's to work. | # this should also allow functools.partial's to work. | |||
if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).par ameters.items() if | if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).par ameters.items() if | |||
k in _callable_args_set or v.d efault == Parameter.empty} == _callable_args_set: | k in _callable_args_set or v.d efault == Parameter.empty} == _callable_args_set: | |||
s = s(target=lvars['TARGETS'], | s = s(target=lvars['TARGETS'], | |||
source=lvars['SOURCES'], | source=lvars['SOURCES'], | |||
env=self.env, | env=self.env, | |||
for_signature=(self.mode != SUBST_CMD)) | for_signature=(self.mode == SUBST_SIG)) | |||
else: | else: | |||
# This probably indicates that it's a callable | # This probably indicates that it's a callable | |||
# object that doesn't match our calling arguments | # object that doesn't match our calling arguments | |||
# (like an Action). | # (like an Action). | |||
if self.mode == SUBST_RAW: | if self.mode == SUBST_RAW: | |||
return s | return s | |||
s = self.conv(s) | s = self.conv(s) | |||
return self.substitute(s, lvars) | return self.substitute(s, lvars) | |||
elif s is None: | elif s is None: | |||
return '' | return '' | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |