Skip to content

Commit

Permalink
Update *Edit this page* link (#761)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Tremblay <alex@tremblay.in>
Co-authored-by: Alex Tremblay <alex.claude.tremblay@gmail.com>
  • Loading branch information
3 people committed Jan 3, 2022
1 parent 484f017 commit 9d24fb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ google_analytics:
- 'auto'
repo_name: pypa/pipx
repo_url: https://github.com/pypa/pipx
edit_uri: edit/main/docs/

nav:
- Home: "index.md"
Expand Down
8 changes: 6 additions & 2 deletions src/pipx/commands/reinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ def reinstall(
return EXIT_CODE_REINSTALL_VENV_NONEXISTENT

try:
# use PurePath.relative_to in a try block instead
# of PurePath.is_relative_to, for python 3.6-3.8 compatability
Path(python).relative_to(venv_dir)
python_relative_to_venv_dir = True
except ValueError:
pass
else:
python_relative_to_venv_dir = False

if python_relative_to_venv_dir:
print(
f"{error} Error, the python executable would be deleted!",
"Change it using the --python option or PIPX_DEFAULT_PYTHON environment variable.",
Expand Down

0 comments on commit 9d24fb9

Please sign in to comment.