Skip to content

Commit

Permalink
fixup! build_meta: produce informative error when a dist is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
layday committed Mar 21, 2021
1 parent f3ba213 commit 2cec54e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setuptools/build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2cec54e

Please sign in to comment.