diff options
author | Mats Wichmann <mats@linux.com> | 2021-05-23 17:41:29 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-05-23 17:46:18 (GMT) |
commit | 91aa64d0d5d7803d9fe13e12554988253456da76 (patch) | |
tree | 605db958db4c1ce8ef9adac3b3651c2cc93682a0 /SCons/Environment.py | |
parent | 846518d598325c08e6c98dc2d30f1cbeee0e730b (diff) | |
download | SCons-91aa64d0d5d7803d9fe13e12554988253456da76.zip SCons-91aa64d0d5d7803d9fe13e12554988253456da76.tar.gz SCons-91aa64d0d5d7803d9fe13e12554988253456da76.tar.bz2 |
Update env.Tool behavior and doc
Review comments suggested for consistency env.Tool should also
return the Tool instance.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Environment.py')
-rw-r--r-- | SCons/Environment.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/SCons/Environment.py b/SCons/Environment.py index a324a82..2f2c8b2 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -109,11 +109,11 @@ def apply_tools(env, tools, toolpath): # Filter out null tools from the list. for tool in [_f for _f in tools if _f]: if is_List(tool) or is_Tuple(tool): - toolname = tool[0] - toolargs = tool[1] # should be a dict of kw args - env.Tool(toolname, **toolargs) + # toolargs should be a dict of kw args + toolname, toolargs, *rest = tool + _ = env.Tool(toolname, **toolargs) else: - env.Tool(tool) + _ = env.Tool(tool) # These names are (or will be) controlled by SCons; users should never # set or override them. The warning can optionally be turned off, @@ -1869,7 +1869,7 @@ class Base(SubstitutionEnvironment): def _find_toolpath_dir(self, tp): return self.fs.Dir(self.subst(tp)).srcnode().get_abspath() - def Tool(self, tool, toolpath=None, **kw): + def Tool(self, tool, toolpath=None, **kw) -> SCons.Tool.Tool: if is_String(tool): tool = self.subst(tool) if toolpath is None: @@ -1877,6 +1877,7 @@ class Base(SubstitutionEnvironment): toolpath = list(map(self._find_toolpath_dir, toolpath)) tool = SCons.Tool.Tool(tool, toolpath, **kw) tool(self) + return tool def WhereIs(self, prog, path=None, pathext=None, reject=None): """Find prog in the path. """ |