Skip to content

Commit 801a313

Browse files
authored
Merge pull request pre-commit#1599 from pre-commit/remove_hardcoded_c_python
remove hardcoded python location
2 parents 8f32c5b + 4888644 commit 801a313

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

pre_commit/languages/python.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ def get_default_version() -> str: # pragma: no cover (platform dependent)
114114
if _find_by_py_launcher(exe):
115115
return exe
116116

117-
# Give a best-effort try for windows
118-
default_folder_name = exe.replace('.', '')
119-
if os.path.exists(fr'C:\{default_folder_name}\python.exe'):
120-
return exe
121-
122117
# We tried!
123118
return C.DEFAULT
124119

@@ -155,12 +150,6 @@ def norm_version(version: str) -> str:
155150
if version_exec and version_exec != version:
156151
return version_exec
157152

158-
# If it is in the form pythonx.x search in the default
159-
# place on windows
160-
if version.startswith('python'):
161-
default_folder_name = version.replace('.', '')
162-
return fr'C:\{default_folder_name}\python.exe'
163-
164153
# Otherwise assume it is a path
165154
return os.path.expanduser(version)
166155

0 commit comments

Comments
 (0)