Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove try-except ValueError to allow UnicodeEncodeError to propagate #6786

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove try-except ValueError to allow UnicodeEncodeError to propagate
UnicodeEncodeError is a subclass of UnicodeError and thus a subclass of ValueError.
KristianTanggaard committed Oct 12, 2022
commit c935e92087a69ce09a31254c8d4a993d14699e90
6 changes: 2 additions & 4 deletions src/poetry/mixology/version_solver.py
Original file line number Diff line number Diff line change
@@ -395,10 +395,8 @@ def _get_min(dependency: Dependency) -> tuple[bool, int, int]:
if locked:
return is_specific_marker, Preference.LOCKED, 1

try:
num_packages = len(self._dependency_cache.search_for(dependency))
except ValueError:
num_packages = 0
num_packages = len(self._dependency_cache.search_for(dependency))

if num_packages < 2:
preference = Preference.NO_CHOICE
elif use_latest: