Skip to content

Commit

Permalink
Revert to original version
Browse files Browse the repository at this point in the history
  • Loading branch information
jace-ys committed Oct 25, 2022
1 parent 523e2aa commit 2a09bef
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,8 @@ def find_distribution_files_with_suffix(
for distribution in self.distributions(
name=distribution_name, writable_only=writable_only
):
if not distribution.files:
continue

for file in distribution.files:
files = [] if distribution.files is None else distribution.files
for file in files:
if file.name.endswith(suffix):
yield Path(
distribution.locate_file(file), # type: ignore[no-untyped-call]
Expand All @@ -343,10 +341,8 @@ def find_distribution_files_with_name(
for distribution in self.distributions(
name=distribution_name, writable_only=writable_only
):
if not distribution.files:
continue

for file in distribution.files:
files = [] if distribution.files is None else distribution.files
for file in files:
if file.name == name:
yield Path(
distribution.locate_file(file), # type: ignore[no-untyped-call]
Expand Down Expand Up @@ -376,10 +372,8 @@ def remove_distribution_files(self, distribution_name: str) -> list[Path]:
for distribution in self.distributions(
name=distribution_name, writable_only=True
):
if not distribution.files:
continue

for file in distribution.files:
files = [] if distribution.files is None else distribution.files
for file in files:
path = Path(
distribution.locate_file(file), # type: ignore[no-untyped-call]
)
Expand Down

0 comments on commit 2a09bef

Please sign in to comment.