fix(provider): compare versions as number, not string #15937

"3.10" < "3.3" but v3.10 > v3.3
Fixes #14586
This commit is contained in:
Tejasvi S. Tomar 2021-10-08 02:57:40 +05:30 committed by GitHub
parent 2d206d5ab2
commit e16adbf238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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