Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8e9f927 + 273326b commit 8f32c5bCopy full SHA for 8f32c5b
2 files changed
pre_commit/commands/install_uninstall.py
@@ -55,7 +55,7 @@ def is_our_script(filename: str) -> bool:
55
56
def shebang() -> str:
57
if sys.platform == 'win32':
58
- py = SYS_EXE
+ py, _ = os.path.splitext(SYS_EXE)
59
else:
60
exe_choices = [
61
f'python{sys.version_info[0]}.{sys.version_info[1]}',
tests/commands/install_uninstall_test.py
@@ -56,8 +56,13 @@ def patch_sys_exe(exe):
def test_shebang_windows():
+ with patch_platform('win32'), patch_sys_exe('python'):
+ assert shebang() == '#!/usr/bin/env python'
+
62
63
+def test_shebang_windows_drop_ext():
64
with patch_platform('win32'), patch_sys_exe('python.exe'):
- assert shebang() == '#!/usr/bin/env python.exe'
65
66
67
68
def test_shebang_posix_not_on_path():
0 commit comments