feat(parse_duration): improve the error message

This commit is contained in:
sgerodes 2025-01-08 16:56:03 +01:00
parent 875f7fa47e
commit c09a0ebeb2

View File

@ -73,7 +73,7 @@ def parse_duration(s):
unit = YEAR
s = s[:-len("YEAR")]
else:
raise ValueError("no unit (like day, month, or year) in '%s'" % orig)
raise ValueError("no unit (like s, day, mo, month, or year) in '%s'" % orig)
s = s.strip()
return int(s) * unit