Skip to content

Commit b6a7737

Browse files
committed
patch 7.4.1327
Problem: Channel test doesn't work if Python executable is python.exe. Solution: Find py.exe or python.exe. (Ken Takata)
1 parent 97eba78 commit b6a7737

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/testdir/test_channel.vim

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ if has('unix')
1313
if !(executable('python') && (has('job') || executable('pkill')))
1414
finish
1515
endif
16+
let s:python = 'python'
1617
elseif 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
2126
else
@@ -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)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,8 @@ static char *(features[]) =
747747

748748
static int included_patches[] =
749749
{ /* Add new patch number below this line */
750+
/**/
751+
1327,
750752
/**/
751753
1326,
752754
/**/

0 commit comments

Comments
 (0)