Skip to content

Commit

Permalink
Use chain.from_iterable in artifact_repository.py (apache#18578)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR committed Jun 22, 2020
1 parent 2fbec60 commit 56cfd9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cd/utils/artifact_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]


Expand Down

0 comments on commit 56cfd9c

Please sign in to comment.