Skip to content

Commit

Permalink
Merge pull request #89 from sarugaku/bugfix/windows
Browse files Browse the repository at this point in the history
Fix paths handling on Windows
  • Loading branch information
frostming authored Aug 27, 2020
2 parents 7cb8723 + 14e0652 commit adf3bcc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/89.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skip invalid entries from Windows registry.
2 changes: 1 addition & 1 deletion src/pythonfinder/models/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def _remove_path(self, path):
normalized = normalize_path(current_path)
if normalized != target:
new_order.append(normalized)
new_order = [p for p in reversed(new_order)]
new_order = [ensure_path(p).as_posix() for p in reversed(new_order)]
return attr.evolve(self, path_order=new_order, paths=new_paths)

def _setup_asdf(self):
Expand Down
2 changes: 1 addition & 1 deletion src/pythonfinder/models/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_versions(self):
py_version = PythonVersion.from_windows_launcher(
version_object, name=name, company=company
)
except InvalidPythonVersion:
except (InvalidPythonVersion, AttributeError):
continue
if py_version is None:
continue
Expand Down

0 comments on commit adf3bcc

Please sign in to comment.