diff options
Diffstat (limited to 'runtime/doc/if_pyth.txt')
-rw-r--r-- | runtime/doc/if_pyth.txt | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index e33f89e771..62fd4cc8d4 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -705,12 +705,31 @@ Raising SystemExit exception in python isn't endorsed way to quit vim, use: > You can test what Python version is available with: > if has('python') echo 'there is Python 2.x' - elseif has('python3') + endif + if has('python3') echo 'there is Python 3.x' endif Note however, that if Python 2 and 3 are both available, but not loaded, these has() calls will try to load them. +To avoid loading the dynamic library, only check if Vim was compiled with +python support: > + if has('python_compiled') + echo 'compiled with Python 2.x support' + if has('python_dynamic + echo 'Python 2.x dynamically loaded + endif + endif + if has('python3_compiled') + echo 'compiled with Python 3.x support' + if has('python3_dynamic + echo 'Python 3.x dynamically loaded + endif + endif + +This also tells you whether Python is dynamically loaded, which will fail if +the runtime library cannot be found. + ============================================================================== vim:tw=78:ts=8:ft=help:norl: |