diff options
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | gobject/pygobject.c | 12 |
2 files changed, 15 insertions, 5 deletions
@@ -1,3 +1,11 @@ +2006-05-20 Yevgen Muntyan <muntyan@tamu.edu> + + reviewed by: Gustavo Carneiro + + * gobject/pygobject.c (pygobject_init, pygobject_get_property), + (pygobject_set_property): Bug 341174: Be more specific in + set/get_property error messages. + 2006-05-07 Yevgen Muntyan <muntyan@tamu.edu> reviewed by: Gustavo Carneiro diff --git a/gobject/pygobject.c b/gobject/pygobject.c index cbfe269..f6307ac 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1010,7 +1010,7 @@ pygobject_init(PyGObject *self, PyObject *args, PyObject *kwargs) pspec = g_object_class_find_property (class, key_str); if (!pspec) { PyErr_Format(PyExc_TypeError, - "gobject `%s' doesn't support property `%s'", + "object of type `%s' doesn't support property `%s'", g_type_name(object_type), key_str); goto cleanup; } @@ -1073,8 +1073,9 @@ pygobject_get_property(PyGObject *self, PyObject *args) pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(self->obj), param_name); if (!pspec) { - PyErr_SetString(PyExc_TypeError, - "the object does not support the given parameter"); + PyErr_Format(PyExc_TypeError, + "object of type `%s' does not have property `%s'", + g_type_name(G_OBJECT_TYPE(self->obj)), param_name); return NULL; } if (!(pspec->flags & G_PARAM_READABLE)) { @@ -1105,8 +1106,9 @@ pygobject_set_property(PyGObject *self, PyObject *args) pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(self->obj), param_name); if (!pspec) { - PyErr_SetString(PyExc_TypeError, - "the object does not support the given parameter"); + PyErr_Format(PyExc_TypeError, + "object of type `%s' does not have property `%s'", + g_type_name(G_OBJECT_TYPE(self->obj)), param_name); return NULL; } |
