Imported Upstream version 3.30.3 upstream/3.30.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 24 Nov 2020 03:36:36 +0000 (12:36 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 24 Nov 2020 03:36:36 +0000 (12:36 +0900)
NEWS
gi/gimodule.c
gi/overrides/GObject.py
meson.build
setup.py
tests/test_gdbus.py

diff --git a/NEWS b/NEWS
index bc4b973054c6f82a9e67c116f45aa662a2060a77..6edadfa53fc8e7cb2cd6ac9d6945e1848da33a9f 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 3a616165bb4982e7692fec311d5e18f92b4cd9a5..e25583e56ad3e68f5dd13b37d3744086eb92f400 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 68ba6d50438c305b69ac3171278e110daeab54c4..fb548d81586952d032c7a1fc27f21a4f584c5da4 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 5bf596809f728cb186cf8f6c3ff1f65fed7073ea..714ff7f5845978714a5a925de35433a610cfee28 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 1a6620a862462f77215e7232e2b785df5fbbe3f6..f1b03a8393add64a7ce52cee50f98a51eb61bedc 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 18315afad36641aecf2136c0b8d8cd99f70bcead..6e38abe309a6131b02bdf461c734c1c11aba4331 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()