From 99ef06d8467968ac262b875ef840fd0f5415e402 Mon Sep 17 00:00:00 2001 From: Zaz Brown Date: Mon, 20 Jun 2022 06:17:00 -0700 Subject: refactor(provider): use list comprehension #19027 - list(filter(lambda x: x != "", sys.path)) + [p for p in sys.path if p != ""] --- runtime/autoload/provider/pythonx.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/autoload/provider/pythonx.vim') diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 048f898e62..6211b457d6 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -8,7 +8,7 @@ let s:loaded_pythonx_provider = 1 function! provider#pythonx#Require(host) abort " Python host arguments let prog = provider#python3#Prog() - let args = [prog, '-c', 'import sys; sys.path = list(filter(lambda x: x != "", sys.path)); import neovim; neovim.start_host()'] + let args = [prog, '-c', 'import sys; sys.path = [p for p in sys.path if p != ""]; import neovim; neovim.start_host()'] " Collect registered Python plugins into args @@ -63,7 +63,7 @@ endfunction function! s:import_module(prog, module) abort let prog_version = system([a:prog, '-c' , printf( \ 'import sys; ' . - \ 'sys.path = list(filter(lambda x: x != "", sys.path)); ' . + \ 'sys.path = [p for p in sys.path if p != ""]; ' . \ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' . \ 'import pkgutil; ' . \ 'exit(2*int(pkgutil.get_loader("%s") is None))', -- cgit