From 25358e4f384abe72f89838f225a5146ca75860a8 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Thu, 17 Mar 2022 20:22:17 -0700 Subject: [PATCH] Improve error message when no matching wheel is found (#2284) --- pyodide-build/pyodide_build/buildall.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyodide-build/pyodide_build/buildall.py b/pyodide-build/pyodide_build/buildall.py index f84a648d3..a7fe28497 100755 --- a/pyodide-build/pyodide_build/buildall.py +++ b/pyodide-build/pyodide_build/buildall.py @@ -103,12 +103,12 @@ class Package(BasePackage): def wheel_path(self) -> Path: dist_dir = self.pkgdir / "dist" - wheel, *rest = find_matching_wheels(dist_dir.glob("*.whl")) - if rest: + wheels = list(find_matching_wheels(dist_dir.glob("*.whl"))) + if len(wheels) != 1: raise Exception( - f"Unexpected number of wheels {len(rest) + 1} when building {self.name}" + f"Unexpected number of wheels {len(wheels)} when building {self.name}" ) - return wheel + return wheels[0] def tests_path(self) -> Optional[Path]: tests = list((self.pkgdir / "dist").glob("*-tests.tar"))