neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 5b778a64ec2e82a7d8d28c3c36698cd42a41c539
parent 6a886a2511bbfd24a4d6ecc3f3a75f08a6df9de9
Author: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
Date:   Sun,  7 Jul 2024 11:37:39 +0300

fix(health): fix fetching url with python in provider health (#29594)


Diffstat:
Mruntime/lua/vim/provider/health.lua | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/runtime/lua/vim/provider/health.lua b/runtime/lua/vim/provider/health.lua @@ -409,12 +409,15 @@ local function download(url) return out end elseif vim.fn.executable('python') == 1 then - local script = "try:\n\ - from urllib.request import urlopen\n\ - except ImportError:\n\ - from urllib2 import urlopen\n\ - response = urlopen('" .. url .. "')\n\ - print(response.read().decode('utf8'))\n" + local script = ([[ +try: + from urllib.request import urlopen +except ImportError: + from urllib2 import urlopen + +response = urlopen('%s') +print(response.read().decode('utf8')) +]]):format(url) local out, rc = system({ 'python', '-c', script }) if out == '' and rc ~= 0 then return 'python urllib.request error: ' .. rc