diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index 4a80677..706508a 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -354,7 +354,7 @@ class KleinanzeigenBot(SeleniumMixin): try: self.web_find(By.XPATH, "//*[@id='postad-category-path'][text()]") is_category_auto_selected = True - except: + except BaseException: is_category_auto_selected = False if ad_cfg["category"]: diff --git a/kleinanzeigen_bot/utils.py b/kleinanzeigen_bot/utils.py index 286cead..add0223 100644 --- a/kleinanzeigen_bot/utils.py +++ b/kleinanzeigen_bot/utils.py @@ -143,7 +143,7 @@ def load_dict(filepath:str, content_label:str = "", must_exist = True) -> Option LOG.info("Loading %s[%s]...", content_label and content_label + " from " or "", filepath) _, file_ext = os.path.splitext(filepath) - if not file_ext in [ ".json", ".yaml" , ".yml" ]: + if file_ext not in [".json", ".yaml", ".yml"]: raise ValueError(f'Unsupported file type. The file name "{filepath}" must end with *.json, *.yaml, or *.yml') if not os.path.exists(filepath): @@ -159,7 +159,7 @@ def load_dict_from_module(module:ModuleType, filename:str, content_label:str = " LOG.debug("Loading %s[%s.%s]...", content_label and content_label + " from " or "", module.__name__, filename) _, file_ext = os.path.splitext(filename) - if not file_ext in [ ".json", ".yaml" , ".yml" ]: + if file_ext not in [".json", ".yaml", ".yml"]: raise ValueError(f'Unsupported file type. The file name "{filename}" must end with *.json, *.yaml, or *.yml') try: diff --git a/pyproject.toml b/pyproject.toml index cb27c1c..39b20ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,7 +100,7 @@ logging-modules = "logging" [tool.pylint.messages_control] # https://pylint.pycqa.org/en/latest/technical_reference/features.html#messages-control-options disable= [ - "bare-except", + "broad-except", "missing-docstring", "multiple-imports", "multiple-statements",