@@ -13,9 +13,14 @@ if has('unix')
1313 if ! (executable (' python' ) && (has (' job' ) || executable (' pkill' )))
1414 finish
1515 endif
16+ let s: python = ' python'
1617elseif has (' win32' )
17- " Use Python Launcher for Windows (py.exe).
18- if ! executable (' py' )
18+ " Use Python Launcher for Windows (py.exe) if available.
19+ if executable (' py.exe' )
20+ let s: python = ' py.exe'
21+ elseif executable (' python.exe' )
22+ let s: python = ' python.exe'
23+ else
1924 finish
2025 endif
2126else
@@ -32,11 +37,11 @@ func s:run_server(testfunc)
3237
3338 try
3439 if has (' job' )
35- let s: job = job_start (" python test_channel.py" )
40+ let s: job = job_start (s: python . " test_channel.py" )
3641 elseif has (' win32' )
37- silent ! start cmd /c start " test_channel" py test_channel.py
42+ exe ' silent !start cmd /c start "test_channel" ' . s: python . ' test_channel.py'
3843 else
39- silent ! python test_channel.py &
44+ exe ' silent !' . s: python . ' test_channel.py&'
4045 endif
4146
4247 " Wait for up to 2 seconds for the port number to be there.
@@ -77,7 +82,7 @@ func s:kill_server()
7782 unlet s: job
7883 endif
7984 elseif has (' win32' )
80- call system (' taskkill /IM py.exe /T /F /FI "WINDOWTITLE eq test_channel"' )
85+ call system (' taskkill /IM ' . s: python . ' /T /F /FI "WINDOWTITLE eq test_channel"' )
8186 else
8287 call system (" pkill -f test_channel.py" )
8388 endif
@@ -283,7 +288,7 @@ func Test_pipe()
283288 if ! has (' job' )
284289 return
285290 endif
286- let job = job_start (" python test_channel_pipe.py" )
291+ let job = job_start (s: python . " test_channel_pipe.py" )
287292 call assert_equal (" run" , job_status (job))
288293 try
289294 let handle = job_getchannel (job)
0 commit comments