mirror of
https://github.com/beetbox/beets.git
synced 2026-01-16 05:02:28 +01:00
more flake8 updates
This commit is contained in:
parent
d466f8802c
commit
18c512893e
1 changed files with 4 additions and 2 deletions
|
|
@ -556,13 +556,15 @@ class Period(object):
|
|||
ordinal = string.count('-')
|
||||
if ordinal >= len(cls.date_formats):
|
||||
# Too many components.
|
||||
raise InvalidQueryArgumentTypeError(string, 'a valid datetime string')
|
||||
raise InvalidQueryArgumentTypeError(string,
|
||||
'a valid datetime string')
|
||||
date_format = cls.date_formats[ordinal]
|
||||
try:
|
||||
date = datetime.strptime(string, date_format)
|
||||
except ValueError:
|
||||
# Parsing failed.
|
||||
raise InvalidQueryArgumentTypeError(string, 'a valid datetime string')
|
||||
raise InvalidQueryArgumentTypeError(string,
|
||||
'a valid datetime string')
|
||||
precision = cls.precisions[ordinal]
|
||||
return cls(date, precision)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue