From 2cec54e4f451d6318ad9fc18213d0f8f7d4aa669 Mon Sep 17 00:00:00 2001 From: layday Date: Sun, 21 Mar 2021 22:00:29 +0200 Subject: fixup! build_meta: produce informative error when a dist is not found --- setuptools/build_meta.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py index 36fbc9e8..de856854 100644 --- a/setuptools/build_meta.py +++ b/setuptools/build_meta.py @@ -102,11 +102,13 @@ def _file_with_extension(directory, extension): if f.endswith(extension) ) try: - return next(matching) - except StopIteration: + file, = matching + except ValueError: raise ValueError( 'No distribution was found. Ensure that `setup.py` ' 'is not empty and that it calls `setup()`.') + else: + return file def _open_setup_script(setup_script): -- cgit v1.2.1