mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 00:24:47 +04:00
remove hardcoded python location
This commit is contained in:
parent
8f32c5b929
commit
4888644990
1 changed files with 0 additions and 11 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue