diff runtime/doc/if_pyth.txt @ 13125:371ceeebbdaa

Update runtime files. commit https://github.com/vim/vim/commit/40962ec9c0e7b8699e101182b06ddd39dc0e1212 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 28 22:47:25 2018 +0100 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Sun, 28 Jan 2018 23:00:08 +0100
parents 8862bf5adf7b
children 167a030448fa
line wrap: on
line diff
--- 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 i
 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 
 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*