Ensure parse_delta_str doesn't puke

This patch fixes an issue where the parse_delta_str regex doesn't
match anything.
This commit is contained in:
Hemna 2023-09-14 16:23:49 -04:00
parent 81a19dd101
commit 140fa4ace4
1 changed files with 5 additions and 1 deletions

View File

@ -126,4 +126,8 @@ def parse_delta_str(s):
)
else:
m = re.match(r"(?P<hours>\d+):(?P<minutes>\d+):(?P<seconds>\d[\.\d+]*)", s)
return {key: float(val) for key, val in m.groupdict().items()}
if m:
return {key: float(val) for key, val in m.groupdict().items()}
else:
return {}