changeset 12806:ef93c4415667 v8.0.1280

patch 8.0.1280: Python None cannot be converted to a Vim type commit https://github.com/vim/vim/commit/de323093e1be165a3eadd1ab3d02942358cd97bf Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 9 19:56:08 2017 +0100 patch 8.0.1280: Python None cannot be converted to a Vim type Problem: Python None cannot be converted to a Vim type. Solution: Convert it to v:none. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Thu, 09 Nov 2017 20:00:05 +0100
parents 4626b2fbab80
children 504ec77bef23
files runtime/doc/if_pyth.txt src/if_py_both.h src/testdir/test86.ok src/testdir/test87.ok src/version.c
diffstat 5 files changed, 56 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -715,6 +715,8 @@ To facilitate bi-directional interface, 
 functions to evaluate Python expressions and pass their values to Vim script.
 |pyxeval()| is also available.
 
+The Python value "None" is converted to v:none.
+
 ==============================================================================
 9. Dynamic loading					*python-dynamic*
 
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -5713,7 +5713,7 @@ run_eval(const char *cmd, typval_T *rett
     }
     else
     {
-	if (run_ret != Py_None && ConvertFromPyObject(run_ret, rettv) == -1)
+	if (ConvertFromPyObject(run_ret, rettv) == -1)
 	    EMSG(_("E859: Failed to convert returned python object to vim value"));
 	Py_DECREF(run_ret);
     }
@@ -6231,6 +6231,11 @@ ConvertFromPyObject(PyObject *obj, typva
 
 	Py_DECREF(num);
     }
+    else if (obj == Py_None)
+    {
+	tv->v_type = VAR_SPECIAL;
+	tv->vval.v_number = VVAL_NONE;
+    }
     else
     {
 	PyErr_FORMAT(PyExc_TypeError,
--- a/src/testdir/test86.ok
+++ b/src/testdir/test86.ok
@@ -87,7 +87,7 @@ ll:[1]
 ['a', 'b']
 ['c', 1]
 ['d', ['e']]
-pyeval("None") = 0
+pyeval("None") = v:none
 0.0
 "\0":	Vim(let):E859:
 {"\0": 1}:	Vim(let):E859:
@@ -768,7 +768,7 @@ d["a"] = {"abcF" : FailingIter()}:TypeEr
 d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s}
-d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',)
+d["a"] = {"abcF" : None}:NOT FAILED
 d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',)
 d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',)
 d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:('keys',)
@@ -795,7 +795,7 @@ d["a"] = Mapping({"abcG" : FailingIter()
 d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s})
-d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',)
+d["a"] = Mapping({"abcG" : None}):NOT FAILED
 d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',)
 d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',)
 d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:('keys',)
@@ -807,7 +807,7 @@ d["a"] = FailingIter():TypeError:('unabl
 d["a"] = FailingIterNext():NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = %s
-d["a"] = None:TypeError:('unable to convert NoneType to vim structure',)
+d["a"] = None:NOT FAILED
 d["a"] = {"": 1}:ValueError:('empty keys are not allowed',)
 d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',)
 d["a"] = FailingMapping():NotImplementedError:('keys',)
@@ -844,7 +844,7 @@ d.update({"abcF" : FailingIter()}):TypeE
 d.update({"abcF" : FailingIterNext()}):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update({"abcF" : %s})
-d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
+d.update({"abcF" : None}):NOT FAILED
 d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
 d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
 d.update({"abcF" : FailingMapping()}):NotImplementedError:('keys',)
@@ -871,7 +871,7 @@ d.update(Mapping({"abcG" : FailingIter()
 d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s}))
-d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
+d.update(Mapping({"abcG" : None})):NOT FAILED
 d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
 d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
 d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
@@ -915,7 +915,7 @@ d.update((("a", {"abcF" : FailingIter()}
 d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),))
-d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',)
+d.update((("a", {"abcF" : None}),)):error:("failed to add key 'a' to dictionary",)
 d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',)
 d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',)
 d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:('keys',)
@@ -942,7 +942,7 @@ d.update((("a", Mapping({"abcG" : Failin
 d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),))
-d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',)
+d.update((("a", Mapping({"abcG" : None})),)):error:("failed to add key 'a' to dictionary",)
 d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',)
 d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',)
 d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:('keys',)
@@ -954,7 +954,7 @@ d.update((("a", FailingIter()),)):TypeEr
 d.update((("a", FailingIterNext()),)):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", %s),))
-d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',)
+d.update((("a", None),)):error:("failed to add key 'a' to dictionary",)
 d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',)
 d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',)
 d.update((("a", FailingMapping()),)):NotImplementedError:('keys',)
@@ -993,7 +993,7 @@ vim.List([{"abcF" : FailingIter()}]):Typ
 vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
-vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
+vim.List([{"abcF" : None}]):NOT FAILED
 vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
 vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
 vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',)
@@ -1020,7 +1020,7 @@ vim.List([Mapping({"abcG" : FailingIter(
 vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
-vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
+vim.List([Mapping({"abcG" : None})]):NOT FAILED
 vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
 vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
 vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',)
@@ -1032,7 +1032,7 @@ vim.List([FailingIter()]):TypeError:('un
 vim.List([FailingIterNext()]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([%s])
-vim.List([None]):TypeError:('unable to convert NoneType to vim structure',)
+vim.List([None]):NOT FAILED
 vim.List([{"": 1}]):ValueError:('empty keys are not allowed',)
 vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',)
 vim.List([FailingMapping()]):NotImplementedError:('keys',)
@@ -1078,7 +1078,7 @@ l[:] = [{"abcF" : FailingIter()}]:TypeEr
 l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}]
-l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',)
+l[:] = [{"abcF" : None}]:NOT FAILED
 l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',)
 l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',)
 l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:('keys',)
@@ -1105,7 +1105,7 @@ l[:] = [Mapping({"abcG" : FailingIter()}
 l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})]
-l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',)
+l[:] = [Mapping({"abcG" : None})]:NOT FAILED
 l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',)
 l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',)
 l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:('keys',)
@@ -1117,7 +1117,7 @@ l[:] = [FailingIter()]:TypeError:('unabl
 l[:] = [FailingIterNext()]:NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [%s]
-l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',)
+l[:] = [None]:NOT FAILED
 l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',)
 l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',)
 l[:] = [FailingMapping()]:NotImplementedError:('keys',)
@@ -1149,7 +1149,7 @@ l.extend([{"abcF" : FailingIter()}]):Typ
 l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}])
-l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',)
+l.extend([{"abcF" : None}]):NOT FAILED
 l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
 l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
 l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',)
@@ -1176,7 +1176,7 @@ l.extend([Mapping({"abcG" : FailingIter(
 l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})])
-l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',)
+l.extend([Mapping({"abcG" : None})]):NOT FAILED
 l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
 l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
 l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',)
@@ -1188,7 +1188,7 @@ l.extend([FailingIter()]):TypeError:('un
 l.extend([FailingIterNext()]):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([%s])
-l.extend([None]):TypeError:('unable to convert NoneType to vim structure',)
+l.extend([None]):NOT FAILED
 l.extend([{"": 1}]):ValueError:('empty keys are not allowed',)
 l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',)
 l.extend([FailingMapping()]):NotImplementedError:('keys',)
@@ -1236,7 +1236,7 @@ f({"abcF" : FailingIter()}):TypeError:('
 f({"abcF" : FailingIterNext()}):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using f({"abcF" : %s})
-f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
+f({"abcF" : None}):NOT FAILED
 f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
 f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
 f({"abcF" : FailingMapping()}):NotImplementedError:('keys',)
@@ -1263,7 +1263,7 @@ f(Mapping({"abcG" : FailingIter()})):Typ
 f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s}))
-f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
+f(Mapping({"abcG" : None})):NOT FAILED
 f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
 f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
 f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
@@ -1275,7 +1275,7 @@ f(FailingIter()):TypeError:('unable to c
 f(FailingIterNext()):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using f(%s)
-f(None):TypeError:('unable to convert NoneType to vim structure',)
+f(None):NOT FAILED
 f({"": 1}):ValueError:('empty keys are not allowed',)
 f({u"": 1}):ValueError:('empty keys are not allowed',)
 f(FailingMapping()):NotImplementedError:('keys',)
@@ -1302,7 +1302,7 @@ fd(self={"abcF" : FailingIter()}):TypeEr
 fd(self={"abcF" : FailingIterNext()}):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s})
-fd(self={"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',)
+fd(self={"abcF" : None}):NOT FAILED
 fd(self={"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',)
 fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',)
 fd(self={"abcF" : FailingMapping()}):NotImplementedError:('keys',)
@@ -1329,7 +1329,7 @@ fd(self=Mapping({"abcG" : FailingIter()}
 fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',)
 <<< Finished
 >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s}))
-fd(self=Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',)
+fd(self=Mapping({"abcG" : None})):NOT FAILED
 fd(self=Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',)
 fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',)
 fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',)
--- a/src/testdir/test87.ok
+++ b/src/testdir/test87.ok
@@ -87,7 +87,7 @@ ll:[1]
 ['a', 'b']
 ['c', 1]
 ['d', ['e']]
-py3eval("None") = 0
+py3eval("None") = v:none
 0.0
 "\0":	Vim(let):E859:
 {"\0": 1}:	Vim(let):E859:
@@ -768,7 +768,7 @@ d["a"] = {"abcF" : FailingIter()}:(<clas
 d["a"] = {"abcF" : FailingIterNext()}:(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s}
-d["a"] = {"abcF" : None}:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d["a"] = {"abcF" : None}:NOT FAILED
 d["a"] = {"abcF" : {b"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = {"abcF" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = {"abcF" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -795,7 +795,7 @@ d["a"] = Mapping({"abcG" : FailingIter()
 d["a"] = Mapping({"abcG" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s})
-d["a"] = Mapping({"abcG" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d["a"] = Mapping({"abcG" : None}):NOT FAILED
 d["a"] = Mapping({"abcG" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = Mapping({"abcG" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = Mapping({"abcG" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -807,7 +807,7 @@ d["a"] = FailingIter():(<class 'TypeErro
 d["a"] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d["a"] = %s
-d["a"] = None:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d["a"] = None:NOT FAILED
 d["a"] = {b"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -844,7 +844,7 @@ d.update({"abcF" : FailingIter()}):(<cla
 d.update({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update({"abcF" : %s})
-d.update({"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d.update({"abcF" : None}):NOT FAILED
 d.update({"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -871,7 +871,7 @@ d.update(Mapping({"abcG" : FailingIter()
 d.update(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s}))
-d.update(Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d.update(Mapping({"abcG" : None})):NOT FAILED
 d.update(Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -915,7 +915,7 @@ d.update((("a", {"abcF" : FailingIter()}
 d.update((("a", {"abcF" : FailingIterNext()}),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),))
-d.update((("a", {"abcF" : None}),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d.update((("a", {"abcF" : None}),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",))
 d.update((("a", {"abcF" : {b"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", {"abcF" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", {"abcF" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -942,7 +942,7 @@ d.update((("a", Mapping({"abcG" : Failin
 d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),))
-d.update((("a", Mapping({"abcG" : None})),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d.update((("a", Mapping({"abcG" : None})),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",))
 d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", Mapping({"abcG" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -954,7 +954,7 @@ d.update((("a", FailingIter()),)):(<clas
 d.update((("a", FailingIterNext()),)):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using d.update((("a", %s),))
-d.update((("a", None),)):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+d.update((("a", None),)):(<class 'vim.error'>, error("failed to add key 'a' to dictionary",))
 d.update((("a", {b"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -993,7 +993,7 @@ vim.List([{"abcF" : FailingIter()}]):(<c
 vim.List([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
-vim.List([{"abcF" : None}]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+vim.List([{"abcF" : None}]):NOT FAILED
 vim.List([{"abcF" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1020,7 +1020,7 @@ vim.List([Mapping({"abcG" : FailingIter(
 vim.List([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
-vim.List([Mapping({"abcG" : None})]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+vim.List([Mapping({"abcG" : None})]):NOT FAILED
 vim.List([Mapping({"abcG" : {b"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1032,7 +1032,7 @@ vim.List([FailingIter()]):(<class 'TypeE
 vim.List([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using vim.List([%s])
-vim.List([None]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+vim.List([None]):NOT FAILED
 vim.List([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1078,7 +1078,7 @@ l[:] = [{"abcF" : FailingIter()}]:(<clas
 l[:] = [{"abcF" : FailingIterNext()}]:(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}]
-l[:] = [{"abcF" : None}]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l[:] = [{"abcF" : None}]:NOT FAILED
 l[:] = [{"abcF" : {b"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [{"abcF" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [{"abcF" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1105,7 +1105,7 @@ l[:] = [Mapping({"abcG" : FailingIter()}
 l[:] = [Mapping({"abcG" : FailingIterNext()})]:(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})]
-l[:] = [Mapping({"abcG" : None})]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l[:] = [Mapping({"abcG" : None})]:NOT FAILED
 l[:] = [Mapping({"abcG" : {b"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [Mapping({"abcG" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [Mapping({"abcG" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1117,7 +1117,7 @@ l[:] = [FailingIter()]:(<class 'TypeErro
 l[:] = [FailingIterNext()]:(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l[:] = [%s]
-l[:] = [None]:(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l[:] = [None]:NOT FAILED
 l[:] = [{b"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1149,7 +1149,7 @@ l.extend([{"abcF" : FailingIter()}]):(<c
 l.extend([{"abcF" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}])
-l.extend([{"abcF" : None}]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l.extend([{"abcF" : None}]):NOT FAILED
 l.extend([{"abcF" : {b"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([{"abcF" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([{"abcF" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1176,7 +1176,7 @@ l.extend([Mapping({"abcG" : FailingIter(
 l.extend([Mapping({"abcG" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})])
-l.extend([Mapping({"abcG" : None})]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l.extend([Mapping({"abcG" : None})]):NOT FAILED
 l.extend([Mapping({"abcG" : {b"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([Mapping({"abcG" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([Mapping({"abcG" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1188,7 +1188,7 @@ l.extend([FailingIter()]):(<class 'TypeE
 l.extend([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using l.extend([%s])
-l.extend([None]):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+l.extend([None]):NOT FAILED
 l.extend([{b"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 l.extend([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1236,7 +1236,7 @@ f({"abcF" : FailingIter()}):(<class 'Typ
 f({"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using f({"abcF" : %s})
-f({"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+f({"abcF" : None}):NOT FAILED
 f({"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f({"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f({"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1263,7 +1263,7 @@ f(Mapping({"abcG" : FailingIter()})):(<c
 f(Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s}))
-f(Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+f(Mapping({"abcG" : None})):NOT FAILED
 f(Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f(Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f(Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1275,7 +1275,7 @@ f(FailingIter()):(<class 'TypeError'>, T
 f(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using f(%s)
-f(None):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+f(None):NOT FAILED
 f({b"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1302,7 +1302,7 @@ fd(self={"abcF" : FailingIter()}):(<clas
 fd(self={"abcF" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s})
-fd(self={"abcF" : None}):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+fd(self={"abcF" : None}):NOT FAILED
 fd(self={"abcF" : {b"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 fd(self={"abcF" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 fd(self={"abcF" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError('keys',))
@@ -1329,7 +1329,7 @@ fd(self=Mapping({"abcG" : FailingIter()}
 fd(self=Mapping({"abcG" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError('next',))
 <<< Finished
 >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s}))
-fd(self=Mapping({"abcG" : None})):(<class 'TypeError'>, TypeError('unable to convert NoneType to vim structure',))
+fd(self=Mapping({"abcG" : None})):NOT FAILED
 fd(self=Mapping({"abcG" : {b"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 fd(self=Mapping({"abcG" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
 fd(self=Mapping({"abcG" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError('keys',))
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1280,
+/**/
     1279,
 /**/
     1278,