From 44acf2f4712105d72bf5fae93578dadac74a6232 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 15 Mar 2019 19:50:38 +0100 Subject: [PATCH] Catch syntaxerror on import --- freqtrade/resolvers/iresolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/resolvers/iresolver.py b/freqtrade/resolvers/iresolver.py index 6023bc2ba..86b9a799b 100644 --- a/freqtrade/resolvers/iresolver.py +++ b/freqtrade/resolvers/iresolver.py @@ -33,9 +33,9 @@ class IResolver(object): module = importlib.util.module_from_spec(spec) try: spec.loader.exec_module(module) # type: ignore # importlib does not use typehints - except ModuleNotFoundError as err: + except (ModuleNotFoundError, SyntaxError) as err: # Catch errors in case a specific module is not installed - logger.info(f"Could not import {module_path} due to '{err}'") + logger.warning(f"Could not import {module_path} due to '{err}'") valid_objects_gen = ( obj for name, obj in inspect.getmembers(module, inspect.isclass)