From 9fbaf2d2ea49adb97cc45be83a966fb3c7f292f2 Mon Sep 17 00:00:00 2001 From: "Eric N. Vander Weele" Date: Sun, 28 Jul 2019 10:39:27 -0400 Subject: [PATCH] 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. --- src/flake8/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flake8/utils.py b/src/flake8/utils.py index 02f0607..cf88648 100644 --- a/src/flake8/utils.py +++ b/src/flake8/utils.py @@ -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 []