Enable flake8-return linting rules (#267)

See https://docs.astral.sh/ruff/rules/#flake8-raise-rse.
This commit is contained in:
Marc Wrobel
2023-12-30 11:47:28 +01:00
parent c985bf4d5e
commit 801859d78a
4 changed files with 10 additions and 8 deletions

View File

@@ -45,8 +45,7 @@ def parse_datetime(text: str, formats: list[str] = frozenset([
for fmt in formats:
try:
date = datetime.strptime(text, fmt) # NOQA: DTZ007, timezone is handled below
date = date.astimezone(timezone.utc) if to_utc else date
return date
return date.astimezone(timezone.utc) if to_utc else date
except ValueError:
pass