diff options
author | Florian Walch <florian@fwalch.com> | 2015-09-16 23:38:34 +0200 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2015-09-17 18:48:26 +0200 |
commit | e3540a430b5173131722781869b55ad08b3784aa (patch) | |
tree | e5fc9fcfcfbfbe1030c2bb35ce7702f416e2fa64 /test/functional/eval/msgpack_functions_spec.lua | |
parent | c416e6874e7382721e52720983cd8c283dd738f1 (diff) | |
download | rneovim-e3540a430b5173131722781869b55ad08b3784aa.tar.gz rneovim-e3540a430b5173131722781869b55ad08b3784aa.tar.bz2 rneovim-e3540a430b5173131722781869b55ad08b3784aa.zip |
provider/pythonx: Improve detection code and error messages.
"python -c" returns 1 in case of an error. Use a return code of 2 if
the Neovim module is not found to distinguish these cases.
Verify the interpreter version before checking for an installed Neovim
module. Show a new error message if the Python interpreter version
is below the minimum required version.
Always use "pkgutil" to determine if the Neovim module is installed.
In contrast to "importlib", which was used for Python 3,
"pkgutil.find_loader" is available for all Python versions [1,2].
"pkgutil.find_loader" internally uses "importlib" for Python >= 3.3 [2].
Also, the previously used "importlib.find_loader" is only available
since Python 3.3 (so checking the major Python version was not enough)
and deprecated since Python 3.4 [3].
Finally, conditioning on the major version in Vimscript was incorrect,
as checking the Neovim module for a certain Python major version does
not mean that the tested interpreters are actually of that version.
For example, we test the "python" executable, which is Python 2 on
Ubuntu and Python 3 on Arch Linux.
[1] https://docs.python.org/2/library/pkgutil.html#pkgutil.find_loader
[2] https://docs.python.org/3/library/pkgutil.html#pkgutil.find_loader
[3] https://docs.python.org/3/library/importlib.html#importlib.find_loader
Diffstat (limited to 'test/functional/eval/msgpack_functions_spec.lua')
0 files changed, 0 insertions, 0 deletions