summaryrefslogtreecommitdiffstats
path: root/runtime/doc/if_pyth.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-01-28 22:47:25 +0100
committerBram Moolenaar <Bram@vim.org>2018-01-28 22:47:25 +0100
commit40962ec9c0e7b8699e101182b06ddd39dc0e1212 (patch)
tree8949df2955a3d9cc6c0e4a6e89aa123a31c0abbd /runtime/doc/if_pyth.txt
parent84b242c369a22b581c43de9de0152f0baedd71ab (diff)
Update runtime files.
Diffstat (limited to 'runtime/doc/if_pyth.txt')
-rw-r--r--runtime/doc/if_pyth.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index b4577fc681..6969c5db1a 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -1,4 +1,4 @@
-*if_pyth.txt* For Vim version 8.0. Last change: 2017 Nov 09
+*if_pyth.txt* For Vim version 8.0. Last change: 2018 Jan 28
VIM REFERENCE MANUAL by Paul Moore
@@ -809,7 +809,8 @@ 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
@@ -818,6 +819,24 @@ dynamically, these has() calls will try to load them. If only one can be
loaded at a time, just checking if Python 2 or 3 are available will prevent
the other one from being available.
+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.
+
==============================================================================
11. Python X *python_x* *pythonx*