Skip to content

Commit 9cb83c3

Browse files
committed
Prefer list comprehension to init/append loop. Ref #936.
1 parent 8c272f0 commit 9cb83c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setuptools/command/egg_info.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,11 @@ def recursive_exclude(self, dir, pattern):
429429

430430
def graft(self, dir):
431431
"""Include all files from 'dir/'."""
432-
found = []
433-
for match_dir in glob(dir):
434-
found += distutils.filelist.findall(match_dir)
432+
found = [
433+
item
434+
for match_dir in glob(dir)
435+
for item in distutils.filelist.findall(match_dir)
436+
]
435437
self.extend(found)
436438
return bool(found)
437439

0 commit comments

Comments
 (0)