2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

Teach use_config to more gracefully fail during options() call #2043

This commit is contained in:
Alan Ray 2017-09-22 18:45:13 -04:00 committed by Thomas Nagy
parent f7833e73ff
commit 1e994e50fb

View File

@ -149,6 +149,9 @@ def load_tool(tool, tooldir=None, ctx=None, with_sys_path=True):
try:
module = Context.load_tool_default(tool, tooldir, ctx, with_sys_path)
except ImportError as e:
if not ctx or not hasattr(Options.options, 'download'):
Logs.error('Could not load %r during options phase (download unavailable at this point)' % tool)
raise
if Options.options.download:
module = download_tool(tool, ctx=ctx)
if not module: