[pygobject] Also deal with foreign boxed structs



commit b1049b947d073fb569ba900a4d5c8519482d831e
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Wed Jan 19 17:35:09 2011 +0100

    Also deal with foreign boxed structs
    
    cairo.Context has been boxed and our tests started failing
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639967

 gi/pygi-argument.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 2ba63f6..8dd728d 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1510,6 +1510,8 @@ _pygi_argument_to_object (GIArgument  *arg,
                     type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info);
                     if (g_type_is_a (type, G_TYPE_VALUE)) {
                         object = pyg_value_as_pyobject (arg->v_pointer, FALSE);
+                    } else if (g_struct_info_is_foreign (info)) {
+                        object = pygi_struct_foreign_convert_from_g_argument (type_info, arg->v_pointer);
                     } else if (g_type_is_a (type, G_TYPE_BOXED)) {
                         PyObject *py_type;
 
@@ -1533,8 +1535,6 @@ _pygi_argument_to_object (GIArgument  *arg,
                         }
 
                         Py_XDECREF (py_type);
-                    } else if ( (type == G_TYPE_NONE) && (g_struct_info_is_foreign (info))) {
-                        object = pygi_struct_foreign_convert_from_g_argument (type_info, arg->v_pointer);
                     } else if (type == G_TYPE_NONE) {
                         PyObject *py_type;
 



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