utils: Assert desired contract for parse_comma_separated_list()

This is a separate commit so it can be dropped during a rebase or
reverted independently.
This commit is contained in:
Eric N. Vander Weele 2019-07-28 10:39:27 -04:00
parent 862b17d229
commit 9fbaf2d2ea

View file

@ -39,6 +39,10 @@ def parse_comma_separated_list(value, regexp=COMMA_SEPARATED_LIST_RE):
:rtype:
list
"""
assert isinstance( # nosec (for bandit)
value, (string_types, type(None))
), value
if not value:
return []