Imported Upstream version 3.30.3 upstream/3.30.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 25 Nov 2020 05:47:46 +0000 (14:47 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 25 Nov 2020 05:47:46 +0000 (14:47 +0900)
NEWS
gi/gimodule.c
gi/overrides/GObject.py
meson.build
setup.py
tests/test_gdbus.py

diff --git a/NEWS b/NEWS
index bc4b973..6edadfa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+3.30.3 - 2018-11-27
+-------------------
+
+* GValue: fall back to the custom C marshaller to support fundamental types.
+  This makes GValue work with GstFraction. :issue:`280`
+* GValue: Work around wrong annotations for GVariant
+* Fix GObject attribute access during instance init which can lead to errors
+  with __getattr__ implementations of subclasses. This lead to criticals when
+  instantiating Gio.DBusProxy. :issue:`267`
+
+
 3.30.2 - 2018-11-11
 -------------------
 
index 3a61616..e25583e 100644 (file)
@@ -1066,7 +1066,7 @@ pygobject__g_instance_init(GTypeInstance   *instance,
     }
 
     /* XXX: used for Gtk.Template */
-    if (PyObject_HasAttrString (wrapper, "__dontuse_ginstance_init__")) {
+    if (PyObject_HasAttrString ((PyObject*) Py_TYPE (wrapper), "__dontuse_ginstance_init__")) {
         result = PyObject_CallMethod (wrapper, "__dontuse_ginstance_init__", NULL);
         if (result == NULL)
             PyErr_Print ();
index 68ba6d5..fb548d8 100644 (file)
@@ -297,7 +297,9 @@ class Value(GObjectModule.Value):
         elif gtype == TYPE_PYOBJECT:
             self.set_boxed(py_value)
         else:
-            raise TypeError("Unknown value type %s" % gtype)
+            # Fall back to _gvalue_set which handles some more cases
+            # like fundamentals for which a converter is registered
+            _gi._gvalue_set(self, py_value)
 
     def get_value(self):
         gtype = self.g_type
@@ -343,11 +345,15 @@ class Value(GObjectModule.Value):
         elif gtype == TYPE_GTYPE:
             return self.get_gtype()
         elif gtype == TYPE_VARIANT:
-            return self.get_variant()
+            # get_variant was missing annotations
+            # https://gitlab.gnome.org/GNOME/glib/merge_requests/492
+            return self.dup_variant()
         elif gtype == TYPE_PYOBJECT:
-            pass
-        else:
+            return self.get_boxed()
+        elif gtype == _gi.TYPE_INVALID:
             return None
+        else:
+            return _gi._gvalue_get(self)
 
     def __repr__(self):
         return '<Value (%s) %s>' % (self.g_type.name, self.get_value())
index 5bf5968..714ff7f 100644 (file)
@@ -1,5 +1,5 @@
 project('pygobject', 'c',
-  version : '3.30.2',
+  version : '3.30.3',
   meson_version : '>= 0.46.0',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized'])
index 1a6620a..f1b03a8 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ from distutils import dir_util, log
 from distutils.spawn import find_executable
 
 
-PYGOBJECT_VERISON = "3.30.2"
+PYGOBJECT_VERISON = "3.30.3"
 GLIB_VERSION_REQUIRED = "2.38.0"
 GI_VERSION_REQUIRED = "1.46.0"
 PYCAIRO_VERSION_REQUIRED = "1.11.1"
index 18315af..6e38abe 100644 (file)
@@ -248,3 +248,10 @@ class TestGDBusClient(unittest.TestCase):
 
         self.assertTrue(isinstance(data['error'], Exception))
         self.assertTrue('InvalidArgs' in str(data['error']), str(data['error']))
+
+    def test_instantiate_custom_proxy(self):
+        class SomeProxy(Gio.DBusProxy):
+            def __init__(self):
+                Gio.DBusProxy.__init__(self)
+
+        SomeProxy()