[pygobject] Chain up with the non-introspection implementation for properties if needed



commit ddffa70c3ee0e837070f390632bc692430f79171
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Wed Jul 28 11:10:42 2010 +0200

    Chain up with the non-introspection implementation for properties if needed

 gobject/pygobject.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index b6bd9ca..804f392 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -367,6 +367,7 @@ PyGProps_setattro(PyGProps *self, PyObject *attr, PyObject *pvalue)
     GParamSpec *pspec;
     char *attr_name;
     GObject *obj;
+    int ret = -1;
     
     if (pvalue == NULL) {
 	PyErr_SetString(PyExc_TypeError, "properties cannot be "
@@ -386,8 +387,12 @@ PyGProps_setattro(PyGProps *self, PyObject *attr, PyObject *pvalue)
         return -1;
     }
 
-    if (pygi_set_property_value (self->pygobject, attr_name, pvalue) == 0)
+    ret = pygi_set_property_value (self->pygobject, attr_name, pvalue);
+    if (ret == 0)
         return 0;
+    else if (ret == -1)
+        if (PyErr_Occurred())
+            return -1;
 
     obj = self->pygobject->obj;
     pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(obj), attr_name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]