From 56cfd9c272e81988682db6fde1b9205becc6a235 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Mon, 22 Jun 2020 21:23:04 +0300 Subject: [PATCH] Use chain.from_iterable in artifact_repository.py (#18578) --- cd/utils/artifact_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/utils/artifact_repository.py b/cd/utils/artifact_repository.py index be7d383ec8d2..41893d93020f 100644 --- a/cd/utils/artifact_repository.py +++ b/cd/utils/artifact_repository.py @@ -496,7 +496,7 @@ def sanitize_path_array(paths: List[str]) -> List[str]: :return: A sanitized list of paths :raises FileNotFoundError if a file does not exist """ - expanded_paths = list(chain(*[glob.glob(path.strip()) for path in paths if path.strip() != ''])) + expanded_paths = list(chain.from_iterable(glob.glob(path.strip()) for path in paths if path.strip() != '')) return [path.strip() for path in expanded_paths if path.strip() != '' and is_file(path)]