From 4900c091a6c88d58780d1ce8c4def0bd04c61270 Mon Sep 17 00:00:00 2001 From: pankaj Date: Fri, 19 May 2023 19:35:29 +0530 Subject: [PATCH] use logger.warning logger.warn() is depricated. logger.warning is already being used in some files. --- searx/engines/__init__.py | 2 +- searx/locales.py | 2 +- searx/search/processors/abstract.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index c9026f96d..a2db26816 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -95,7 +95,7 @@ def load_engine(engine_data: dict) -> Optional[Engine]: return None if engine_name.lower() != engine_name: - logger.warn('Engine name is not lowercase: "{}", converting to lowercase'.format(engine_name)) + logger.warning('Engine name is not lowercase: "{}", converting to lowercase'.format(engine_name)) engine_name = engine_name.lower() engine_data['name'] = engine_name diff --git a/searx/locales.py b/searx/locales.py index c765eb198..12066f3d7 100644 --- a/searx/locales.py +++ b/searx/locales.py @@ -460,7 +460,7 @@ def build_engine_locales(tag_list: List[str]): for tag in tag_list: locale = get_locale(tag) if locale is None: - logger.warn("build_engine_locales: skip locale tag %s / unknown by babel", tag) + logger.warning("build_engine_locales: skip locale tag %s / unknown by babel", tag) continue if locale.territory: engine_locales[region_tag(locale)] = tag diff --git a/searx/search/processors/abstract.py b/searx/search/processors/abstract.py index 5f1882ca4..ace730e54 100644 --- a/searx/search/processors/abstract.py +++ b/searx/search/processors/abstract.py @@ -74,7 +74,7 @@ class EngineProcessor(ABC): try: self.engine.init(get_engine_from_settings(self.engine_name)) except SearxEngineResponseException as exc: - self.logger.warn('Fail to initialize // %s', exc) + self.logger.warning('Fail to initialize // %s', exc) except Exception: # pylint: disable=broad-except self.logger.exception('Fail to initialize') else: