File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -612,16 +612,18 @@ def _filter_tar(tarinfo):
612
612
613
613
exclude = []
614
614
615
- for ignore_file in [".dockerignore" , ".containerignore" ]:
616
- if os .path .exists (ignore_file ):
617
- with open (ignore_file , "r" ) as f :
615
+ for ignore_file_name in [".dockerignore" , ".containerignore" ]:
616
+ if os .path .exists (ignore_file_name ):
617
+ with open (ignore_file_name , "r" ) as ignore_file :
618
+ cleaned_lines = [
619
+ line .strip () for line in ignore_file .read ().splitlines ()
620
+ ]
618
621
exclude .extend (
619
- list (
620
- filter (
621
- lambda x : x != "" and x [0 ] != "#" ,
622
- [l .strip () for l in f .read ().splitlines ()],
623
- )
624
- )
622
+ [
623
+ line
624
+ for line in cleaned_lines
625
+ if line != "" and line [0 ] != "#"
626
+ ]
625
627
)
626
628
627
629
if not exclude :
You can’t perform that action at this time.
0 commit comments