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)
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 7c205f8..9315324 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1918,11 +1918,17 @@
}
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