Skip to content

Commit

Permalink
Merge pull request #4449 from DimitriPapadopoulos/PERF
Browse files Browse the repository at this point in the history
Apply ruff/Perflint rule PERF401
  • Loading branch information
jaraco authored Jun 29, 2024
2 parents 0581003 + ae472b4 commit 11b2f5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions setuptools/command/bdist_egg.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ def get_ext_outputs(self):

paths = {self.bdist_dir: ''}
for base, dirs, files in sorted_walk(self.bdist_dir):
for filename in files:
if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS:
all_outputs.append(paths[base] + filename)
all_outputs.extend(
paths[base] + filename
for filename in files
if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS
)
for filename in dirs:
paths[os.path.join(base, filename)] = paths[base] + filename + '/'

Expand Down
9 changes: 5 additions & 4 deletions setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,10 +1203,11 @@ def build_and_install(self, setup_script, setup_base):

self.run_setup(setup_script, setup_base, args)
all_eggs = Environment([dist_dir])
eggs = []
for key in all_eggs:
for dist in all_eggs[key]:
eggs.append(self.install_egg(dist.location, setup_base))
eggs = [
self.install_egg(dist.location, setup_base)
for key in all_eggs
for dist in all_eggs[key]
]
if not eggs and not self.dry_run:
log.warn("No eggs found in %s (setup script problem?)", dist_dir)
return eggs
Expand Down

0 comments on commit 11b2f5f

Please sign in to comment.