diff src/if_python.c @ 15888:a83c4b1f8ea2 v8.1.0950

patch 8.1.0950: using :python sets 'pyxversion' even when not executed commit https://github.com/vim/vim/commit/14816ad6e58336773443f5ee2e4aa9e384af65d2 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 18 22:04:56 2019 +0100 patch 8.1.0950: using :python sets 'pyxversion' even when not executed Problem: Using :python sets 'pyxversion' even when not executed. Solution: Check the "skip" flag. (Shane Harper, closes https://github.com/vim/vim/issues/3995)
author Bram Moolenaar <Bram@vim.org>
date Mon, 18 Feb 2019 22:15:07 +0100
parents 7fad90423bd2
children 831f9e74eded
line wrap: on
line diff
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -1109,12 +1109,12 @@ ex_python(exarg_T *eap)
 {
     char_u *script;
 
-    if (p_pyx == 0)
-	p_pyx = 2;
-
     script = script_get(eap, eap->arg);
     if (!eap->skip)
     {
+	if (p_pyx == 0)
+	    p_pyx = 2;
+
 	DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script,
 		(rangeinitializer) init_range_cmd,
 		(runner) run_cmd,