Don't crash if a strategy imports something wrongly

This commit is contained in:
Matthias 2020-09-05 16:51:19 +02:00
parent c18441f36f
commit 8c9297e1f0

View File

@ -59,7 +59,7 @@ class IResolver:
module = importlib.util.module_from_spec(spec)
try:
spec.loader.exec_module(module) # type: ignore # importlib does not use typehints
except (ModuleNotFoundError, SyntaxError) as err:
except (ModuleNotFoundError, SyntaxError, ImportError) as err:
# Catch errors in case a specific module is not installed
logger.warning(f"Could not import {module_path} due to '{err}'")
if enum_failed: