summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-17 22:37:03 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-17 22:37:03 +0100
commit77324fc9d3206a12f5ae39da1574be3ee1273591 (patch)
treeaca0c1818fb8f4869a3bd81e02c11132c00ca77f
parent85084ef1e999dcf50e8d466106a33bac24a0febb (diff)
downloadvim-77324fc9d3206a12f5ae39da1574be3ee1273591.zip
patch 7.4.1129
Problem: Python None value can't be converted to a Vim value. Solution: Just use zero. (Damien)
-rw-r--r--src/if_py_both.h2
-rw-r--r--src/testdir/test86.in2
-rw-r--r--src/testdir/test86.ok1
-rw-r--r--src/testdir/test87.in2
-rw-r--r--src/testdir/test87.ok1
-rw-r--r--src/version.c2
6 files changed, 9 insertions, 1 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 1ad7dc616..e220e3fec 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -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);
}
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index 4714451ee..cc76cff8d 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -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)
diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok
index 5cb0ac574..d103909ca 100644
--- a/src/testdir/test86.ok
+++ b/src/testdir/test86.ok
@@ -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:
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 41d406521..154e82382 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -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)
diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok
index 777173393..1d9b6e257 100644
--- a/src/testdir/test87.ok
+++ b/src/testdir/test87.ok
@@ -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:
diff --git a/src/version.c b/src/version.c
index 5e5a31990..ed7eddc35 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1129,
+/**/
1128,
/**/
1127,