|
|
3ef2ca |
To: vim_dev@googlegroups.com
|
|
|
3ef2ca |
Subject: Patch 7.4.176
|
|
|
3ef2ca |
Fcc: outbox
|
|
|
3ef2ca |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
3ef2ca |
Mime-Version: 1.0
|
|
|
3ef2ca |
Content-Type: text/plain; charset=UTF-8
|
|
|
3ef2ca |
Content-Transfer-Encoding: 8bit
|
|
|
3ef2ca |
------------
|
|
|
3ef2ca |
|
|
|
3ef2ca |
Patch 7.4.176
|
|
|
3ef2ca |
Problem: Dictionary.update() thows an error when used without arguments.
|
|
|
3ef2ca |
Python programmers don't expect that.
|
|
|
3ef2ca |
Solution: Make Dictionary.update() without arguments do nothing. (ZyX)
|
|
|
3ef2ca |
Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test87.in
|
|
|
3ef2ca |
|
|
|
3ef2ca |
|
|
|
3ef2ca |
*** ../vim-7.4.175/src/if_py_both.h 2014-02-11 16:00:31.198157698 +0100
|
|
|
3ef2ca |
--- src/if_py_both.h 2014-02-11 18:41:12.774305435 +0100
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 1918,1928 ****
|
|
|
3ef2ca |
}
|
|
|
3ef2ca |
else
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
! PyObject *obj;
|
|
|
3ef2ca |
|
|
|
3ef2ca |
! if (!PyArg_ParseTuple(args, "O", &obj))
|
|
|
3ef2ca |
return NULL;
|
|
|
3ef2ca |
|
|
|
3ef2ca |
if (PyObject_HasAttrString(obj, "keys"))
|
|
|
3ef2ca |
return DictionaryUpdate(self, NULL, obj);
|
|
|
3ef2ca |
else
|
|
|
3ef2ca |
--- 1919,1935 ----
|
|
|
3ef2ca |
}
|
|
|
3ef2ca |
else
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
! PyObject *obj = NULL;
|
|
|
3ef2ca |
|
|
|
3ef2ca |
! if (!PyArg_ParseTuple(args, "|O", &obj))
|
|
|
3ef2ca |
return NULL;
|
|
|
3ef2ca |
|
|
|
3ef2ca |
+ if (obj == NULL)
|
|
|
3ef2ca |
+ {
|
|
|
3ef2ca |
+ Py_INCREF(Py_None);
|
|
|
3ef2ca |
+ return Py_None;
|
|
|
3ef2ca |
+ }
|
|
|
3ef2ca |
+
|
|
|
3ef2ca |
if (PyObject_HasAttrString(obj, "keys"))
|
|
|
3ef2ca |
return DictionaryUpdate(self, NULL, obj);
|
|
|
3ef2ca |
else
|
|
|
3ef2ca |
*** ../vim-7.4.175/src/testdir/test86.in 2014-01-14 16:54:53.000000000 +0100
|
|
|
3ef2ca |
--- src/testdir/test86.in 2014-02-11 17:25:08.414235496 +0100
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 39,44 ****
|
|
|
3ef2ca |
--- 39,45 ----
|
|
|
3ef2ca |
py << EOF
|
|
|
3ef2ca |
d=vim.bindeval('d')
|
|
|
3ef2ca |
d['1']='asd'
|
|
|
3ef2ca |
+ d.update() # Must not do anything, including throwing errors
|
|
|
3ef2ca |
d.update(b=[1, 2, f])
|
|
|
3ef2ca |
d.update((('-1', {'a': 1}),))
|
|
|
3ef2ca |
d.update({'0': -1})
|
|
|
3ef2ca |
*** ../vim-7.4.175/src/testdir/test87.in 2014-01-14 16:54:53.000000000 +0100
|
|
|
3ef2ca |
--- src/testdir/test87.in 2014-02-11 17:25:12.602235560 +0100
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 33,38 ****
|
|
|
3ef2ca |
--- 33,39 ----
|
|
|
3ef2ca |
py3 << EOF
|
|
|
3ef2ca |
d=vim.bindeval('d')
|
|
|
3ef2ca |
d['1']='asd'
|
|
|
3ef2ca |
+ d.update() # Must not do anything, including throwing errors
|
|
|
3ef2ca |
d.update(b=[1, 2, f])
|
|
|
3ef2ca |
d.update((('-1', {'a': 1}),))
|
|
|
3ef2ca |
d.update({'0': -1})
|
|
|
3ef2ca |
*** ../vim-7.4.175/src/version.c 2014-02-11 17:05:57.282217857 +0100
|
|
|
3ef2ca |
--- src/version.c 2014-02-11 18:46:37.518310411 +0100
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 740,741 ****
|
|
|
3ef2ca |
--- 740,743 ----
|
|
|
3ef2ca |
{ /* Add new patch number below this line */
|
|
|
3ef2ca |
+ /**/
|
|
|
3ef2ca |
+ 176,
|
|
|
3ef2ca |
/**/
|
|
|
3ef2ca |
|
|
|
3ef2ca |
--
|
|
|
3ef2ca |
"Intelligence has much less practical application than you'd think."
|
|
|
3ef2ca |
-- Scott Adams, Dilbert.
|
|
|
3ef2ca |
|
|
|
3ef2ca |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
3ef2ca |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
3ef2ca |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
3ef2ca |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|