From fa7d688a4e9f1bc5ff567e38dcf3391cb4e0f44a Mon Sep 17 00:00:00 2001 From: Hamid Date: Mon, 15 Apr 2024 11:04:19 +0200 Subject: [PATCH] latest_date is nullable --- src/migmose/parsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/migmose/parsing.py b/src/migmose/parsing.py index 7ddfa8d..c8af366 100644 --- a/src/migmose/parsing.py +++ b/src/migmose/parsing.py @@ -67,11 +67,11 @@ def extract_date(file_path: Path) -> tuple[datetime, Path]: # Initialize variables to keep track of the latest file and date latest_file: Path - latest_date: datetime + latest_date: datetime | None = None for file_path in file_list: date, path = extract_date(file_path) - if date > latest_date: + if latest_date is None or date > latest_date: latest_file = path latest_date = date