Skip to content

Commit

Permalink
style: silence flake8-blind-except warnings
Browse files Browse the repository at this point in the history
BLE001 Do not catch blind exception: `Exception`
  • Loading branch information
DimitriPapadopoulos committed Jan 13, 2024
1 parent 0d7ae7b commit 8b2e188
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yamllint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def extend(self, base_config):
def parse(self, raw_content):
try:
conf = yaml.safe_load(raw_content)
except Exception as e:
except yaml.YAMLError as e:
raise YamlLintConfigError(f'invalid config: {e}') from e

if not isinstance(conf, dict):
Expand All @@ -94,7 +94,7 @@ def parse(self, raw_content):
base = YamlLintConfig(file=path)
try:
self.extend(base)
except Exception as e:
except AssertionError as e:
raise YamlLintConfigError(f'invalid config: {e}') from e

if 'ignore' in conf and 'ignore-from-file' in conf:
Expand Down Expand Up @@ -142,7 +142,7 @@ def validate(self):
for id in self.rules:
try:
rule = yamllint.rules.get(id)
except Exception as e:
except ValueError as e:
raise YamlLintConfigError(f'invalid config: {e}') from e

self.rules[id] = validate_rule_conf(rule, self.rules[id])
Expand Down

0 comments on commit 8b2e188

Please sign in to comment.