Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply ruff/Perflint rule PERF401 #4449

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading