]> granicus.if.org Git - vim/commitdiff
patch 7.4.1129 v7.4.1129
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2016 21:37:03 +0000 (22:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2016 21:37:03 +0000 (22:37 +0100)
Problem:    Python None value can't be converted to a Vim value.
Solution:   Just use zero. (Damien)

src/if_py_both.h
src/testdir/test86.in
src/testdir/test86.ok
src/testdir/test87.in
src/testdir/test87.ok
src/version.c

index 1ad7dc616d54ea63cb2a2e0b16fdec56bcfb3a5c..e220e3fec7d312e949a6d24d9504c2cc10a4695c 100644 (file)
@@ -5521,7 +5521,7 @@ run_eval(const char *cmd, typval_T *rettv
     }
     else
     {
-       if (ConvertFromPyObject(run_ret, rettv) == -1)
+       if (run_ret != Py_None && ConvertFromPyObject(run_ret, rettv) == -1)
            EMSG(_("E859: Failed to convert returned python object to vim value"));
        Py_DECREF(run_ret);
     }
index 4714451eeb0fd469a19ba65b8f923c1eae9f9beb..cc76cff8d40379918f92499d3444efe150578698 100644 (file)
@@ -329,6 +329,8 @@ EOF
 :$put =string(l)
 :let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}')
 :$put =sort(items(d))
+:let v:errmsg = ''
+:$put ='pyeval(\"None\") = ' . pyeval('None') . v:errmsg
 :if has('float')
 :   let f=pyeval('0.0')
 :   $put =string(f)
index 5cb0ac57405c9e94ce273114ff08320a29ac18a7..d103909ca15d3972a3e8694a01bb849b5833ff81 100644 (file)
@@ -86,6 +86,7 @@ ll:[1]
 ['a', 'b']
 ['c', 1]
 ['d', ['e']]
+pyeval("None") = 0
 0.0
 "\0":  Vim(let):E859:
 {"\0": 1}:     Vim(let):E859:
index 41d406521ed13de6ca571e96f823c8905465c535..154e82382733a0b57b2a2f96443ad32cb8de29d0 100644 (file)
@@ -326,6 +326,8 @@ EOF
 :$put =string(l)
 :let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}')
 :$put =sort(items(d))
+:let v:errmsg = ''
+:$put ='py3eval(\"None\") = ' . py3eval('None') . v:errmsg
 :if has('float')
 :   let f=py3eval('0.0')
 :   $put =string(f)
index 7771733937aafdeb235465b6f2566980191ef41c..1d9b6e257840b3af281f7e9f03e3636912a09d01 100644 (file)
@@ -86,6 +86,7 @@ ll:[1]
 ['a', 'b']
 ['c', 1]
 ['d', ['e']]
+py3eval("None") = 0
 0.0
 "\0":  Vim(let):E859:
 {"\0": 1}:     Vim(let):E859:
index 5e5a31990afcbd34e6084ab1103babd4ca65e776..ed7eddc35186264a9fcc3fc56a2525e1f3d62661 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1129,
 /**/
     1128,
 /**/