Skip to content

Commit

Permalink
Fix AttributeError on hash mismatch
Browse files Browse the repository at this point in the history
This replaces the AttributeError reported in #4085 with the proper
exception.
  • Loading branch information
paulmelnikow committed Jul 5, 2021
1 parent 22c3aad commit 403d2ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,9 @@ def _download_link(self, operation: Union[Install, Update], link: Link) -> Link:
).hash()
)
if archive_hash not in {f["hash"] for f in package.files}:
filename = archive.filename if isinstance(archive, Link) else archive
raise RuntimeError(
f"Invalid hash for {package} using archive {archive.name}"
f"Invalid hash for {package} using archive {filename}"
)

self._hashes[package.name] = archive_hash
Expand Down

0 comments on commit 403d2ff

Please sign in to comment.