Hi list,

Vim function `py{,3}eval()` cannot used with a void expression.
    :call pyeval('None')
    E859: Failed to convert returned python object to vim value

This is expected?

Thanks,
Damien

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/if_py_both.h b/src/if_py_both.h
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -5521,7 +5521,7 @@
     }
     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
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -329,6 +329,8 @@
 :$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
--- a/src/testdir/test86.ok
+++ b/src/testdir/test86.ok
@@ -86,6 +86,7 @@
 ['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
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -326,6 +326,8 @@
 :$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
--- a/src/testdir/test87.ok
+++ b/src/testdir/test87.ok
@@ -86,6 +86,7 @@
 ['a', 'b']
 ['c', 1]
 ['d', ['e']]
+py3eval("None") = 0
 0.0
 "\0":	Vim(let):E859:
 {"\0": 1}:	Vim(let):E859:

Raspunde prin e-mail lui