diff --git a/PRESUBMIT.py b/PRESUBMIT.py index a6e05e75ff1e9..8bbde3dc6a22c 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -3278,7 +3278,7 @@ def _CheckCrbugLinksHaveHttps(input_api, output_api): """Checks that crbug(.com) links are correctly prefixed by https://, unless they come in the accepted form TODO(crbug.com/...) """ - white_list = r'.+%s' % _IMPLEMENTATION_EXTENSIONS + white_list = (r'.+%s' % _IMPLEMENTATION_EXTENSIONS, ) black_list = (_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS) sources = lambda f: input_api.FilterSourceFile( f, white_list=white_list, black_list=black_list) diff --git a/PRESUBMIT_test_mocks.py b/PRESUBMIT_test_mocks.py index 3b491d963ed2c..ed6a750de3238 100644 --- a/PRESUBMIT_test_mocks.py +++ b/PRESUBMIT_test_mocks.py @@ -94,12 +94,16 @@ def FilterSourceFile(self, file, white_list=(), black_list=()): local_path = file.LocalPath() found_in_white_list = not white_list if white_list: + if type(white_list) is str: + raise TypeError('white_list should be an iterable of strings') for pattern in white_list: compiled_pattern = re.compile(pattern) if compiled_pattern.search(local_path): found_in_white_list = True break if black_list: + if type(black_list) is str: + raise TypeError('black_list should be an iterable of strings') for pattern in black_list: compiled_pattern = re.compile(pattern) if compiled_pattern.search(local_path):