mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 09:04:41 +04:00
Merge pull request #1599 from pre-commit/remove_hardcoded_c_python
remove hardcoded python location
This commit is contained in:
commit
801a31302d
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):
|
if _find_by_py_launcher(exe):
|
||||||
return 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!
|
# We tried!
|
||||||
return C.DEFAULT
|
return C.DEFAULT
|
||||||
|
|
||||||
|
|
@ -155,12 +150,6 @@ def norm_version(version: str) -> str:
|
||||||
if version_exec and version_exec != version:
|
if version_exec and version_exec != version:
|
||||||
return version_exec
|
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
|
# Otherwise assume it is a path
|
||||||
return os.path.expanduser(version)
|
return os.path.expanduser(version)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue