Commit 6d25e6e5 authored by Niklas Selke's avatar Niklas Selke
Browse files

If the 'seasons' argument is required but None no 'ValueError' will be raised.

parent 141ca8fc
...@@ -250,14 +250,14 @@ def check_seasons(seasons_in, seasons_req): ...@@ -250,14 +250,14 @@ def check_seasons(seasons_in, seasons_req):
required required
:raises ValueError: raised if the seasons argument is required and :raises ValueError: raised if the seasons argument is required and
either missing or is not a type of list or a not None and either not a type of list or a
string or if no season is given or if any given string or empty or any given season is not
season is not recognized recognized
:return: A list of seasons or None if the seasons argument is not :return: A list of seasons or None if the seasons argument is either
needed not needed or None
""" """
if not seasons_req: if not seasons_req or seasons_in is None:
return None return None
if not isinstance(seasons_in, (list, set, tuple, str)): if not isinstance(seasons_in, (list, set, tuple, str)):
raise ValueError("The seasons argument must be a list, set, tuple or" raise ValueError("The seasons argument must be a list, set, tuple or"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment