0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.1129

Problem:    Python None value can't be converted to a Vim value.
Solution:   Just use zero. (Damien)
This commit is contained in:
Bram Moolenaar
2016-01-17 22:37:03 +01:00
parent 85084ef1e9
commit 77324fc9d3
6 changed files with 9 additions and 1 deletions

View File

@@ -5521,7 +5521,7 @@ run_eval(const char *cmd, typval_T *rettv
} }
else 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")); EMSG(_("E859: Failed to convert returned python object to vim value"));
Py_DECREF(run_ret); Py_DECREF(run_ret);
} }

View File

@@ -329,6 +329,8 @@ EOF
:$put =string(l) :$put =string(l)
:let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}') :let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}')
:$put =sort(items(d)) :$put =sort(items(d))
:let v:errmsg = ''
:$put ='pyeval(\"None\") = ' . pyeval('None') . v:errmsg
:if has('float') :if has('float')
: let f=pyeval('0.0') : let f=pyeval('0.0')
: $put =string(f) : $put =string(f)

View File

@@ -86,6 +86,7 @@ ll:[1]
['a', 'b'] ['a', 'b']
['c', 1] ['c', 1]
['d', ['e']] ['d', ['e']]
pyeval("None") = 0
0.0 0.0
"\0": Vim(let):E859: "\0": Vim(let):E859:
{"\0": 1}: Vim(let):E859: {"\0": 1}: Vim(let):E859:

View File

@@ -326,6 +326,8 @@ EOF
:$put =string(l) :$put =string(l)
:let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}') :let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}')
:$put =sort(items(d)) :$put =sort(items(d))
:let v:errmsg = ''
:$put ='py3eval(\"None\") = ' . py3eval('None') . v:errmsg
:if has('float') :if has('float')
: let f=py3eval('0.0') : let f=py3eval('0.0')
: $put =string(f) : $put =string(f)

View File

@@ -86,6 +86,7 @@ ll:[1]
['a', 'b'] ['a', 'b']
['c', 1] ['c', 1]
['d', ['e']] ['d', ['e']]
py3eval("None") = 0
0.0 0.0
"\0": Vim(let):E859: "\0": Vim(let):E859:
{"\0": 1}: Vim(let):E859: {"\0": 1}: Vim(let):E859:

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1129,
/**/ /**/
1128, 1128,
/**/ /**/