rna function api was overwriting useful errors with keyword errors.

fix some missing checks in the python interface.
This commit is contained in:
Campbell Barton 2009-09-17 00:14:47 +00:00
parent 4a15b40c37
commit 1934ee422a
3 changed files with 9 additions and 5 deletions

@ -102,6 +102,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
kb = ob.active_shape_key
row = layout.row()
if key: # XXX - looks crappy
row.template_list(key, "keys", ob, "active_shape_key_index", rows=2)
col = row.column()

@ -66,6 +66,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
split.template_ID(space, "pin_id")
split.itemS()
if mat:
layout.itemR(mat, "type", expand=True)
class MATERIAL_PT_shading(MaterialButtonsPanel):

@ -1994,8 +1994,10 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw)
/* Check if we gave args that dont exist in the function
* printing the error is slow but it should only happen when developing.
* the if below is quick, checking if it passed less keyword args then we gave */
if(kw && (PyDict_Size(kw) > kw_tot)) {
* the if below is quick, checking if it passed less keyword args then we gave.
* (Dont overwrite the error if we have one, otherwise can skip important messages and confuse with args)
*/
if(err == 0 && kw && (PyDict_Size(kw) > kw_tot)) {
PyObject *key, *value;
Py_ssize_t pos = 0;