Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated for version 7.4.176

Problem:    Dictionary.update() thows an error when used without arguments.
	    Python programmers don't expect that.
Solution:   Make Dictionary.update() without arguments do nothing. (ZyX)
  • Loading branch information...
commit 2c232e82119915e902d14f2433132d34cd738387 1 parent 22cc197
@brammool brammool authored
View
10 src/if_py_both.h
@@ -1918,11 +1918,17 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs)
}
else
{
- PyObject *obj;
+ PyObject *obj = NULL;
- if (!PyArg_ParseTuple(args, "O", &obj))
+ if (!PyArg_ParseTuple(args, "|O", &obj))
return NULL;
+ if (obj == NULL)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
if (PyObject_HasAttrString(obj, "keys"))
return DictionaryUpdate(self, NULL, obj);
else
View
1  src/testdir/test86.in
@@ -39,6 +39,7 @@ STARTTEST
py << EOF
d=vim.bindeval('d')
d['1']='asd'
+d.update() # Must not do anything, including throwing errors
d.update(b=[1, 2, f])
d.update((('-1', {'a': 1}),))
d.update({'0': -1})
View
1  src/testdir/test87.in
@@ -33,6 +33,7 @@ STARTTEST
py3 << EOF
d=vim.bindeval('d')
d['1']='asd'
+d.update() # Must not do anything, including throwing errors
d.update(b=[1, 2, f])
d.update((('-1', {'a': 1}),))
d.update({'0': -1})
View
2  src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 176,
+/**/
175,
/**/
174,
Please sign in to comment.
Something went wrong with that request. Please try again.