From 23a99693e3603a47f4bcb7b08351a774923b0f2e Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Mon, 18 May 2020 17:24:40 -0400 Subject: add check for SCons null class --- SCons/Subst.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SCons/Subst.py b/SCons/Subst.py index fbb89b3..cc2eeab 100644 --- a/SCons/Subst.py +++ b/SCons/Subst.py @@ -420,7 +420,10 @@ class StringSubber(object): return conv(substitute(l, lvars)) return list(map(func, s)) elif callable(s): - if (s and + # SCons has the unusual Null class where any __getattr__ call returns it's self, + # which does not work the signature module, and the Null class returns an empty + # string if called on, so we make an exception in this condition for Null class + if (isinstance(s, SCons.Util.Null) or set(signature(s).parameters.keys()) == set(['target', 'source', 'env', 'for_signature'])): s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], @@ -591,7 +594,10 @@ class ListSubber(collections.UserList): self.substitute(a, lvars, 1) self.next_word() elif callable(s): - if (s and + # SCons has the unusual Null class where any __getattr__ call returns it's self, + # which does not work the signature module, and the Null class returns an empty + # string if called on, so we make an exception in this condition for Null class + if (isinstance(s, SCons.Util.Null) or set(signature(s).parameters.keys()) == set(['target', 'source', 'env', 'for_signature'])): s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], -- cgit v0.12