diff --git a/mkdocs.yml b/mkdocs.yml index 52034abee8..bdd1256d6c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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" diff --git a/src/pipx/commands/reinstall.py b/src/pipx/commands/reinstall.py index fc22d5bd2c..177fddb318 100644 --- a/src/pipx/commands/reinstall.py +++ b/src/pipx/commands/reinstall.py @@ -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.",