Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions news/139.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix edge case from refactor to pydantic -- only search for any python version when a specific version was not requested.
4 changes: 2 additions & 2 deletions src/pythonfinder/models/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,14 @@ def alternate_sub_finder(obj):
found_version = sub_finder(path)
if found_version:
return found_version
if alternate_sub_finder:
if name and not (minor or patch or pre or dev or arch or major):
for path in paths:
found_version = alternate_sub_finder(path)
if found_version:
return found_version

ver = next(iter(self.get_pythons(sub_finder)), None)
if not ver and alternate_sub_finder is not None:
if not ver and name and not (minor or patch or pre or dev or arch or major):
ver = next(iter(self.get_pythons(alternate_sub_finder)), None)

if ver:
Expand Down