Merge pull request #25343 from neovim/backport-25342-to-release-0.9

[Backport release-0.9] fix(provider/pythonx): import the correct module
This commit is contained in:
zeertzjq 2023-09-24 22:19:17 +08:00 committed by GitHub
commit c901472d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ endfunction
" Returns array: [prog_exitcode, prog_version]
function! s:import_module(prog, module) abort
let prog_version = system([a:prog, '-W', 'ignore', '-c', printf(
\ 'import sys, importlib; ' .
\ 'import sys, importlib.util; ' .
\ 'sys.path = [p for p in sys.path if p != ""]; ' .
\ 'sys.stdout.write(str(sys.version_info[0]) + "." + str(sys.version_info[1])); ' .
\ 'sys.exit(2 * int(importlib.util.find_spec("%s") is None))',