Skip to content

Commit 11b2f5f

Browse files
authored
Merge pull request #4449 from DimitriPapadopoulos/PERF
Apply ruff/Perflint rule PERF401
2 parents 0581003 + ae472b4 commit 11b2f5f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

setuptools/command/bdist_egg.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ def get_ext_outputs(self):
290290

291291
paths = {self.bdist_dir: ''}
292292
for base, dirs, files in sorted_walk(self.bdist_dir):
293-
for filename in files:
294-
if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS:
295-
all_outputs.append(paths[base] + filename)
293+
all_outputs.extend(
294+
paths[base] + filename
295+
for filename in files
296+
if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS
297+
)
296298
for filename in dirs:
297299
paths[os.path.join(base, filename)] = paths[base] + filename + '/'
298300

setuptools/command/easy_install.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,11 @@ def build_and_install(self, setup_script, setup_base):
12031203

12041204
self.run_setup(setup_script, setup_base, args)
12051205
all_eggs = Environment([dist_dir])
1206-
eggs = []
1207-
for key in all_eggs:
1208-
for dist in all_eggs[key]:
1209-
eggs.append(self.install_egg(dist.location, setup_base))
1206+
eggs = [
1207+
self.install_egg(dist.location, setup_base)
1208+
for key in all_eggs
1209+
for dist in all_eggs[key]
1210+
]
12101211
if not eggs and not self.dry_run:
12111212
log.warn("No eggs found in %s (setup script problem?)", dist_dir)
12121213
return eggs

0 commit comments

Comments
 (0)