[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17964] trunk/blender/source/blender/ python/api2_2x/IDProp.c: id prop update function was receiving a tuple when it only needed a single arg
Campbell Barton
ideasman42 at gmail.com
Sat Dec 20 09:41:48 CET 2008
Revision: 17964
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17964
Author: campbellbarton
Date: 2008-12-20 09:41:46 +0100 (Sat, 20 Dec 2008)
Log Message:
-----------
id prop update function was receiving a tuple when it only needed a single arg
Modified Paths:
--------------
trunk/blender/source/blender/python/api2_2x/IDProp.c
Modified: trunk/blender/source/blender/python/api2_2x/IDProp.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/IDProp.c 2008-12-20 08:24:24 UTC (rev 17963)
+++ trunk/blender/source/blender/python/api2_2x/IDProp.c 2008-12-20 08:41:46 UTC (rev 17964)
@@ -533,21 +533,16 @@
Py_RETURN_FALSE;
}
-static PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *vars)
+static PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *value)
{
- PyObject *pyob, *pkey, *pval;
+ PyObject *pkey, *pval;
Py_ssize_t i=0;
- if (PySequence_Size(vars) != 1)
+ if (!PyDict_Check(value))
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected an object derived from dict.");
-
- pyob = PyTuple_GET_ITEM(vars, 0);
- if (!PyDict_Check(pyob))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object derived from dict.");
- while (PyDict_Next(pyob, &i, &pkey, &pval)) {
+ while (PyDict_Next(value, &i, &pkey, &pval)) {
BPy_IDGroup_Map_SetItem(self, pkey, pval);
if (PyErr_Occurred()) return NULL;
}
@@ -571,7 +566,7 @@
"get the values associated with this group."},
{"has_key", (PyCFunction)BPy_IDGroup_HasKey, METH_O,
"returns true if the group contains a key, false if not."},
- {"update", (PyCFunction)BPy_IDGroup_Update, METH_VARARGS,
+ {"update", (PyCFunction)BPy_IDGroup_Update, METH_O,
"updates the values in the group with the values of another or a dict."},
{"convert_to_pyobject", (PyCFunction)BPy_IDGroup_ConvertToPy, METH_NOARGS,
"return a purely python version of the group."},
More information about the Bf-blender-cvs
mailing list