forked from aniani/vim
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)
This commit is contained in:
@@ -13,9 +13,14 @@ if has('unix')
|
|||||||
if !(executable('python') && (has('job') || executable('pkill')))
|
if !(executable('python') && (has('job') || executable('pkill')))
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
let s:python = 'python'
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
" Use Python Launcher for Windows (py.exe).
|
" Use Python Launcher for Windows (py.exe) if available.
|
||||||
if !executable('py')
|
if executable('py.exe')
|
||||||
|
let s:python = 'py.exe'
|
||||||
|
elseif executable('python.exe')
|
||||||
|
let s:python = 'python.exe'
|
||||||
|
else
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@@ -32,11 +37,11 @@ func s:run_server(testfunc)
|
|||||||
|
|
||||||
try
|
try
|
||||||
if has('job')
|
if has('job')
|
||||||
let s:job = job_start("python test_channel.py")
|
let s:job = job_start(s:python . " test_channel.py")
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
silent !start cmd /c start "test_channel" py test_channel.py
|
exe 'silent !start cmd /c start "test_channel" ' . s:python . ' test_channel.py'
|
||||||
else
|
else
|
||||||
silent !python test_channel.py&
|
exe 'silent !' . s:python . ' test_channel.py&'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Wait for up to 2 seconds for the port number to be there.
|
" Wait for up to 2 seconds for the port number to be there.
|
||||||
@@ -77,7 +82,7 @@ func s:kill_server()
|
|||||||
unlet s:job
|
unlet s:job
|
||||||
endif
|
endif
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
call system('taskkill /IM py.exe /T /F /FI "WINDOWTITLE eq test_channel"')
|
call system('taskkill /IM ' . s:python . ' /T /F /FI "WINDOWTITLE eq test_channel"')
|
||||||
else
|
else
|
||||||
call system("pkill -f test_channel.py")
|
call system("pkill -f test_channel.py")
|
||||||
endif
|
endif
|
||||||
@@ -283,7 +288,7 @@ func Test_pipe()
|
|||||||
if !has('job')
|
if !has('job')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let job = job_start("python test_channel_pipe.py")
|
let job = job_start(s:python . " test_channel_pipe.py")
|
||||||
call assert_equal("run", job_status(job))
|
call assert_equal("run", job_status(job))
|
||||||
try
|
try
|
||||||
let handle = job_getchannel(job)
|
let handle = job_getchannel(job)
|
||||||
|
@@ -747,6 +747,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1327,
|
||||||
/**/
|
/**/
|
||||||
1326,
|
1326,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user