mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
provider/python: Call: fix usage of 'finish' in function
Do not call it again in case of an exception in `remote#host#Require` (ref: https://github.com/neovim/neovim/pull/2549#issuecomment-102674350).
This commit is contained in:
parent
866e587b88
commit
2111f28fc5
@ -32,6 +32,9 @@ call remote#host#RegisterClone('legacy-python-provider', 'python')
|
|||||||
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
|
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
|
||||||
|
|
||||||
function! provider#python#Call(method, args)
|
function! provider#python#Call(method, args)
|
||||||
|
if s:err != ''
|
||||||
|
return
|
||||||
|
endif
|
||||||
if !exists('s:host')
|
if !exists('s:host')
|
||||||
let s:rpcrequest = function('rpcrequest')
|
let s:rpcrequest = function('rpcrequest')
|
||||||
|
|
||||||
@ -39,7 +42,10 @@ function! provider#python#Call(method, args)
|
|||||||
try
|
try
|
||||||
let s:host = remote#host#Require('legacy-python-provider')
|
let s:host = remote#host#Require('legacy-python-provider')
|
||||||
catch
|
catch
|
||||||
|
let s:err = v:exception
|
||||||
|
echohl WarningMsg
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
|
echohl None
|
||||||
finish
|
finish
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
@ -32,6 +32,9 @@ call remote#host#RegisterClone('legacy-python3-provider', 'python3')
|
|||||||
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
|
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
|
||||||
|
|
||||||
function! provider#python3#Call(method, args)
|
function! provider#python3#Call(method, args)
|
||||||
|
if s:err != ''
|
||||||
|
return
|
||||||
|
endif
|
||||||
if !exists('s:host')
|
if !exists('s:host')
|
||||||
let s:rpcrequest = function('rpcrequest')
|
let s:rpcrequest = function('rpcrequest')
|
||||||
|
|
||||||
@ -39,10 +42,12 @@ function! provider#python3#Call(method, args)
|
|||||||
try
|
try
|
||||||
let s:host = remote#host#Require('legacy-python3-provider')
|
let s:host = remote#host#Require('legacy-python3-provider')
|
||||||
catch
|
catch
|
||||||
|
let s:err = v:exception
|
||||||
|
echohl WarningMsg
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
|
echohl None
|
||||||
finish
|
finish
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user