Skip to content

Commit

Permalink
fix: ignore invalid version strinig from winreg (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Apr 18, 2024
1 parent 5e7624a commit 429d961
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/findpython/providers/winreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ def find_pythons(self) -> t.Iterable[PythonVersion]:
continue
if path.exists():
py_version = getattr(version.info, "version", None)
parse_version: Version | None = None
if py_version:
try:
parse_version = Version(py_version)
except ValueError:
pass
py_ver = self.version_maker(
path,
Version(py_version) if py_version else None,
parse_version,
getattr(version.info, "sys_architecture", SYS_ARCHITECTURE),
path,
)
Expand Down

0 comments on commit 429d961

Please sign in to comment.