Skip to content
This repository
Browse code

Call the correct Python interpreter on Python 3 systems

  • Loading branch information...
commit a721bc28bcf1964a1f3700cf8d0df647e51dc143 1 parent 9c0a055
Dmitri Iouchtchenko authored April 29, 2011

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  autoload.vim
8  autoload.vim
@@ -259,12 +259,16 @@ endfunction
259 259
 function! s:run_scanner(keywords, matches) " {{{2
260 260
   " Try to run scanner.py script to find notes matching {keywords}.
261 261
   let scanner = xolox#path#absolute(g:notes_indexscript)
262  
-  if !(executable('python') && filereadable(scanner))
  262
+  let python = 'python'
  263
+  if executable('python2')
  264
+    let python = 'python2'
  265
+  endif
  266
+  if !(executable(python) && filereadable(scanner))
263 267
     call xolox#debug("%s: The %s script isn't executable.", s:script, scanner)
264 268
   else
265 269
     let arguments = [scanner, g:notes_indexfile, g:notes_directory, g:notes_shadowdir, a:keywords]
266 270
     call map(arguments, 'shellescape(v:val)')
267  
-    let output = xolox#trim(system(join(['python'] + arguments)))
  271
+    let output = xolox#trim(system(join([python] + arguments)))
268 272
     if !v:shell_error
269 273
       call extend(a:matches, split(output, '\n'))
270 274
       return 1

0 notes on commit a721bc2

Please sign in to comment.
Something went wrong with that request. Please try again.