changeset 8066:1aa8ed4ee48b v7.4.1327

commit https://github.com/vim/vim/commit/b6a7737938e7e7b34f862f58aa5498e6f652e33d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 15 22:55:28 2016 +0100 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)
author Christian Brabandt <cb@256bit.org>
date Mon, 15 Feb 2016 23:00:05 +0100
parents edbf9c5fe379
children 959c711832dc
files src/testdir/test_channel.vim src/version.c
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -13,9 +13,14 @@ if has('unix')
   if !(executable('python') && (has('job') || executable('pkill')))
     finish
   endif
+  let s:python = 'python'
 elseif has('win32')
-  " Use Python Launcher for Windows (py.exe).
-  if !executable('py')
+  " Use Python Launcher for Windows (py.exe) if available.
+  if executable('py.exe')
+    let s:python = 'py.exe'
+  elseif executable('python.exe')
+    let s:python = 'python.exe'
+  else
     finish
   endif
 else
@@ -32,11 +37,11 @@ func s:run_server(testfunc)
 
   try
     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')
-      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
-      silent !python test_channel.py&
+      exe 'silent !' . s:python . ' test_channel.py&'
     endif
 
     " Wait for up to 2 seconds for the port number to be there.
@@ -77,7 +82,7 @@ func s:kill_server()
       unlet s:job
     endif
   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
     call system("pkill -f test_channel.py")
   endif
@@ -283,7 +288,7 @@ func Test_pipe()
   if !has('job')
     return
   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))
   try
     let handle = job_getchannel(job)
--- a/src/version.c
+++ b/src/version.c
@@ -748,6 +748,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1327,
+/**/
     1326,
 /**/
     1325,