Skip to content

Commit

Permalink
Merge pull request #12579 from wimglenn/err
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Mar 26, 2024
2 parents f5e4ee1 + d2f1f9c commit 5b9306f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/12579.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove duplication in invalid wheel error message
2 changes: 0 additions & 2 deletions src/pip/_internal/metadata/importlib/_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution:
dist = WheelDistribution.from_zipfile(zf, name, wheel.location)
except zipfile.BadZipFile as e:
raise InvalidWheel(wheel.location, name) from e
except UnsupportedWheel as e:
raise UnsupportedWheel(f"{name} has an invalid wheel, {e}")
return cls(dist, dist.info_location, pathlib.PurePosixPath(wheel.location))

@property
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/utils/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def parse_wheel(wheel_zip: ZipFile, name: str) -> Tuple[str, Message]:
metadata = wheel_metadata(wheel_zip, info_dir)
version = wheel_version(metadata)
except UnsupportedWheel as e:
raise UnsupportedWheel(f"{name} has an invalid wheel, {str(e)}")
raise UnsupportedWheel(f"{name} has an invalid wheel, {e}")

check_compatibility(version, name)

Expand Down

0 comments on commit 5b9306f

Please sign in to comment.