remove hardcoded python location

This commit is contained in:
Anthony Sottile
2020-09-15 12:04:25 -07:00
parent 8f32c5b929
commit 4888644990

View File

@@ -114,11 +114,6 @@ def get_default_version() -> str: # pragma: no cover (platform dependent)
if _find_by_py_launcher(exe):
return exe
# Give a best-effort try for windows
default_folder_name = exe.replace('.', '')
if os.path.exists(fr'C:\{default_folder_name}\python.exe'):
return exe
# We tried!
return C.DEFAULT
@@ -155,12 +150,6 @@ def norm_version(version: str) -> str:
if version_exec and version_exec != version:
return version_exec
# If it is in the form pythonx.x search in the default
# place on windows
if version.startswith('python'):
default_folder_name = version.replace('.', '')
return fr'C:\{default_folder_name}\python.exe'
# Otherwise assume it is a path
return os.path.expanduser(version)