Skip to content

Commit 2cec54e

Browse files
committed
fixup! build_meta: produce informative error when a dist is not found
1 parent f3ba213 commit 2cec54e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setuptools/build_meta.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ def _file_with_extension(directory, extension):
102102
if f.endswith(extension)
103103
)
104104
try:
105-
return next(matching)
106-
except StopIteration:
105+
file, = matching
106+
except ValueError:
107107
raise ValueError(
108108
'No distribution was found. Ensure that `setup.py` '
109109
'is not empty and that it calls `setup()`.')
110+
else:
111+
return file
110112

111113

112114
def _open_setup_script(setup_script):

0 commit comments

Comments
 (0)