Skip to content

Commit

Permalink
Throw specific error if narrowed_unstatisfied_names is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
notatallshaw committed Aug 3, 2024
1 parent 5b4d03a commit 8fec685
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/resolvelib/resolvers/resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ def resolve(self, requirements: Iterable[RT], max_rounds: int) -> State[RT, CT,
else:
narrowed_unstatisfied_names = unsatisfied_names

# If there are no unsatisfied names use unsatisfied names
if not narrowed_unstatisfied_names:
raise RuntimeError("narrow_requirement_selection returned 0 names")

# If there is only 1 unsatisfied name skip calling self._get_preference
if len(narrowed_unstatisfied_names) > 1:
# Choose the most preferred unpinned criterion to try.
Expand Down

0 comments on commit 8fec685

Please sign in to comment.