diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-12-20 11:41:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-12-20 11:41:46 +0300 |
commit | c67d26602f9d55be1a4a26ed0646541ca4651624 (patch) | |
tree | 7fb74226055db0206cfffcc6b4fda63d4490c5ce | |
parent | 630c16feb7c8c5e8f128e4e56507c3afceaf9c6f (diff) |
id prop update function was receiving a tuple when it only needed a single arg
-rw-r--r-- | source/blender/python/api2_2x/IDProp.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/python/api2_2x/IDProp.c b/source/blender/python/api2_2x/IDProp.c index 07269e54c7c..6457cd07098 100644 --- a/source/blender/python/api2_2x/IDProp.c +++ b/source/blender/python/api2_2x/IDProp.c @@ -533,21 +533,16 @@ static PyObject *BPy_IDGroup_HasKey(BPy_IDProperty *self, PyObject *value) 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) - return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected an object derived from dict."); - - pyob = PyTuple_GET_ITEM(vars, 0); - if (!PyDict_Check(pyob)) + if (!PyDict_Check(value)) 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 @@ static struct PyMethodDef BPy_IDGroup_methods[] = { "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."}, |