diff options
author | Alexandre Flament <alex@al-f.net> | 2020-08-31 18:59:27 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-08-31 19:00:06 +0200 |
commit | b329058c1ad06fe9c1afd56c81e0ad27dbef06b8 (patch) | |
tree | 8cb271bcbcb15fbb65b27538203e3a2475871e26 /searx/engines/__init__.py | |
parent | 315cdfee09cb34b0006daf76697f7d4f7cfba01d (diff) | |
download | searxng-b329058c1ad06fe9c1afd56c81e0ad27dbef06b8.tar.gz searxng-b329058c1ad06fe9c1afd56c81e0ad27dbef06b8.zip |
Revert "[enh] test: load each engine to check for syntax errors"
This reverts commit 4fb3ed2c6335b68f6b28ebc68d5d22f2fd621648.
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r-- | searx/engines/__init__.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 70b5ba166..48c02e2e7 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -72,8 +72,11 @@ def load_engine(engine_data): engine_module = engine_data['engine'] - # can raise an exception - engine = load_module(engine_module + '.py', engine_dir) + try: + engine = load_module(engine_module + '.py', engine_dir) + except: + logger.exception('Cannot load engine "{}"'.format(engine_module)) + return None for param_name in engine_data: if param_name == 'engine': @@ -251,11 +254,9 @@ def load_engines(engine_list): global engines engines.clear() for engine_data in engine_list: - try: - engine = load_engine(engine_data) + engine = load_engine(engine_data) + if engine is not None: engines[engine.name] = engine - except: - logger.exception('Cannot load engine "{}"'.format(engine_data['engine'])) return engines |