Skip to content

Commit a721bc2

Browse files
committed
Call the correct Python interpreter on Python 3 systems
1 parent 9c0a055 commit a721bc2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autoload.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,16 @@ endfunction
259259
function! s:run_scanner(keywords, matches) " {{{2
260260
" Try to run scanner.py script to find notes matching {keywords}.
261261
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))
263267
call xolox#debug("%s: The %s script isn't executable.", s:script, scanner)
264268
else
265269
let arguments = [scanner, g:notes_indexfile, g:notes_directory, g:notes_shadowdir, a:keywords]
266270
call map(arguments, 'shellescape(v:val)')
267-
let output = xolox#trim(system(join(['python'] + arguments)))
271+
let output = xolox#trim(system(join([python] + arguments)))
268272
if !v:shell_error
269273
call extend(a:matches, split(output, '\n'))
270274
return 1

0 commit comments

Comments
 (0)