diff options
author | William Deegan <bill@baddogconsulting.com> | 2021-02-27 21:14:33 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2021-02-27 21:14:33 (GMT) |
commit | 9c9a35402b537e6ce9e14a4db07a82433b62e475 (patch) | |
tree | f9b97a5984528baded30b9075e3f2d5fae410198 | |
parent | c7a5f84dd8e742a3fc622f94eca6a9c51c8ef92c (diff) | |
download | SCons-9c9a35402b537e6ce9e14a4db07a82433b62e475.zip SCons-9c9a35402b537e6ce9e14a4db07a82433b62e475.tar.gz SCons-9c9a35402b537e6ce9e14a4db07a82433b62e475.tar.bz2 |
switch to using set comprehension in subst callable arg checking logic, instead of set([ list comprehension])
-rw-r--r-- | SCons/Subst.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/SCons/Subst.py b/SCons/Subst.py index eda514e..f23b2d0 100644 --- a/SCons/Subst.py +++ b/SCons/Subst.py @@ -425,8 +425,8 @@ class StringSubber: # 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 # this should also allow functools.partial's to work. - if isinstance(s, SCons.Util.Null) or set([k for k, v in signature(s).parameters.items() if k in _callable_args_set or - v.default == Parameter.empty]) == _callable_args_set: + if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).parameters.items() if + k in _callable_args_set or v.default == Parameter.empty} == _callable_args_set: s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], @@ -602,9 +602,8 @@ class ListSubber(collections.UserList): # 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 # this should also allow functools.partial's to work. - if isinstance(s, SCons.Util.Null) or set( - [k for k, v in signature(s).parameters.items() if k in _callable_args_set or - v.default == Parameter.empty]) == _callable_args_set: + if isinstance(s, SCons.Util.Null) or {k for k, v in signature(s).parameters.items() if + k in _callable_args_set or v.default == Parameter.empty} == _callable_args_set: s = s(target=lvars['TARGETS'], source=lvars['SOURCES'], |