void-packages/srcpkgs/neovim/patches/python-3.10.patch

24 lines
1.2 KiB
Diff
Raw Normal View History

2021-10-12 08:40:05 +00:00
From e78fc38908dfb9f952e75026987f0db1f9ce4253 Mon Sep 17 00:00:00 2001
From: "Tejasvi S. Tomar" <45873379+tejasvi@users.noreply.github.com>
Date: Thu, 7 Oct 2021 11:41:52 +0530
Subject: [PATCH] Fix python provider's minor version comparison
`'3.10' < '3.3'` but v3.10 > v3.3
---
runtime/autoload/provider/pythonx.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim
index c292b374b6f5..0eeb35cba8f1 100644
--- a/runtime/autoload/provider/pythonx.vim
+++ b/runtime/autoload/provider/pythonx.vim
@@ -96,7 +96,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
if prog_version !~ '^' . a:major_version
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python '
\ . a:major_version . '.']
- elseif prog_version =~ '^' . a:major_version && prog_version < min_version
+ elseif prog_version =~ '^' . a:major_version && str2nr(prog_version[2:]) < str2nr(min_version[2:])
return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= '
\ . min_version . '.']
endif