Ensure ConfigurationContext.load/Context.load have the same interface (continued)

This commit is contained in:
Thomas Nagy 2021-05-13 17:02:31 +02:00
parent 86b1f0def1
commit 747a339b7f
1 changed files with 5 additions and 4 deletions

View File

@ -241,14 +241,15 @@ class ConfigurationContext(Context.Context):
"""
tools = Utils.to_list(tool_list)
if tooldir:
tooldir = Utils.to_list(tooldir)
tooldir = Utils.to_list(kw.get('tooldir', ''))
with_sys_path = kw.get('with_sys_path', True)
funs = kw.get('funs')
for tool in tools:
# avoid loading the same tool more than once with the same functions
# used by composite projects
if cache:
mag = (tool, id(self.env), tooldir, funs)
if kw.get('cache'):
mag = (tool, id(self.env), tuple(tooldir), funs)
if mag in self.tool_cache:
self.to_log('(tool %s is already loaded, skipping)' % tool)
continue