Skip to content

Commit 8fec685

Browse files
committed
Throw specific error if narrowed_unstatisfied_names is empty
1 parent 5b4d03a commit 8fec685

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/resolvelib/resolvers/resolution.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,10 @@ def resolve(self, requirements: Iterable[RT], max_rounds: int) -> State[RT, CT,
430430
else:
431431
narrowed_unstatisfied_names = unsatisfied_names
432432

433+
# If there are no unsatisfied names use unsatisfied names
434+
if not narrowed_unstatisfied_names:
435+
raise RuntimeError("narrow_requirement_selection returned 0 names")
436+
433437
# If there is only 1 unsatisfied name skip calling self._get_preference
434438
if len(narrowed_unstatisfied_names) > 1:
435439
# Choose the most preferred unpinned criterion to try.

0 commit comments

Comments
 (0)