[pygobject/pygobject-2-28] [gi] fixes to backport commit 6b5a65 - in older glib GVariants are still structs



commit 0c348da3d974f63629c44e75067b8056dacc60d3
Author: John (J5) Palmieri <johnp redhat com>
Date:   Fri Jun 10 16:46:20 2011 -0400

    [gi] fixes to backport commit 6b5a65 - in older glib GVariants are still structs

 gi/gimodule.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/gimodule.c b/gi/gimodule.c
index f715d0f..5ef166f 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -475,8 +475,10 @@ _wrap_pyg_variant_type_from_string (PyObject *self, PyObject *args)
 
     py_type = _pygi_type_import_by_name ("GLib", "VariantType");
 
-    py_variant = _pygi_boxed_new ( (PyTypeObject *) py_type, type_string, FALSE);
-
+    if (PyType_IsSubtype (py_type, &PyGIBoxed_Type))
+        py_variant = _pygi_boxed_new ( (PyTypeObject *) py_type, type_string, FALSE);
+    else
+        py_variant = _pygi_struct_new ( (PyTypeObject *) py_type, type_string, FALSE);
     return py_variant;
 }
 



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