File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def is_our_script(filename: str) -> bool:
5555
5656def shebang () -> str :
5757 if sys .platform == 'win32' :
58- py = SYS_EXE
58+ py , _ = os . path . splitext ( SYS_EXE )
5959 else :
6060 exe_choices = [
6161 f'python{ sys .version_info [0 ]} .{ sys .version_info [1 ]} ' ,
Original file line number Diff line number Diff line change @@ -56,8 +56,13 @@ def patch_sys_exe(exe):
5656
5757
5858def test_shebang_windows ():
59+ with patch_platform ('win32' ), patch_sys_exe ('python' ):
60+ assert shebang () == '#!/usr/bin/env python'
61+
62+
63+ def test_shebang_windows_drop_ext ():
5964 with patch_platform ('win32' ), patch_sys_exe ('python.exe' ):
60- assert shebang () == '#!/usr/bin/env python.exe '
65+ assert shebang () == '#!/usr/bin/env python'
6166
6267
6368def test_shebang_posix_not_on_path ():
You can’t perform that action at this time.
0 commit comments