From c5140bf3d6e6955749d194c4e8325459f82658b7 Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Thu, 24 Jun 2021 19:40:30 -0400 Subject: [PATCH] Fix AttributeError on hash mismatch This replaces the AttributeError reported in #4085 with the proper exception. --- poetry/installation/executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/installation/executor.py b/poetry/installation/executor.py index 4580656c933..519635fda8b 100644 --- a/poetry/installation/executor.py +++ b/poetry/installation/executor.py @@ -680,7 +680,7 @@ def _download_link(self, operation: Union[Install, Update], link: Link) -> Link: ) if archive_hash not in {f["hash"] for f in package.files}: raise RuntimeError( - f"Invalid hash for {package} using archive {archive.name}" + f"Invalid hash for {package} using archive {archive.filename if isinstance(archive, Link) else archive}" ) self._hashes[package.name] = archive_hash