summaryrefslogtreecommitdiff
path: root/0001-revert-override-of-connection.register_object.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-02-04 07:56:39 +0000
committerCoprDistGit <infra@openeuler.org>2025-02-04 07:56:39 +0000
commit8c1cbe25d38ba9198be10751231aac93089916b1 (patch)
tree4946ca8a80bb5839dcd19829c6b3f52dbba753fb /0001-revert-override-of-connection.register_object.patch
parent40c70d2d420426025bf282e2b023b9cb47233ec6 (diff)
automatic import of pygobject3openeuler24.03_LTS_SP1openeuler24.03_LTS
Diffstat (limited to '0001-revert-override-of-connection.register_object.patch')
-rw-r--r--0001-revert-override-of-connection.register_object.patch140
1 files changed, 140 insertions, 0 deletions
diff --git a/0001-revert-override-of-connection.register_object.patch b/0001-revert-override-of-connection.register_object.patch
new file mode 100644
index 0000000..d80c18c
--- /dev/null
+++ b/0001-revert-override-of-connection.register_object.patch
@@ -0,0 +1,140 @@
+From e86c32092e693ecffcec211133fd1929603948d1 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Sat, 30 Nov 2024 14:59:49 -0800
+Subject: [PATCH] revert override of connection.register_object
+
+This seems to break the exit handler of anaconda (Fedora/RHEL
+installer), such that it often fails to exit properly.
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+---
+ gi/overrides/Gio.py | 31 -------------------
+ tests/test_gdbus.py | 73 ---------------------------------------------
+ 2 files changed, 104 deletions(-)
+
+diff --git a/gi/overrides/Gio.py b/gi/overrides/Gio.py
+index 48c3737a..45256385 100644
+--- a/gi/overrides/Gio.py
++++ b/gi/overrides/Gio.py
+@@ -89,37 +89,6 @@ class DBusArgInfo(Gio.DBusArgInfo):
+ __all__.append('DBusArgInfo')
+
+
+-@override
+-class DBusConnection(Gio.DBusConnection):
+- __init__ = _warn_init(Gio.DBusConnection)
+-
+- def register_object(self,
+- object_path,
+- interface_info,
+- method_call_closure=None,
+- get_property_closure=None,
+- set_property_closure=None):
+- if method_call_closure is not None:
+- def wrapped_method_call_closure(connection, sender, object_path,
+- interface_name, method_name, parameters,
+- invocation):
+- method_call_closure(connection, sender, object_path,
+- interface_name, method_name, parameters,
+- invocation)
+- invocation._unref()
+- else:
+- wrapped_method_call_closure = None
+-
+- return super().register_object(object_path,
+- interface_info,
+- wrapped_method_call_closure,
+- get_property_closure,
+- set_property_closure)
+-
+-
+-__all__.append('DBusConnection')
+-
+-
+ @override
+ class DBusMethodInfo(Gio.DBusMethodInfo):
+ __init__ = _warn_init(Gio.DBusMethodInfo)
+diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py
+index afbf94cb..18fd0e41 100644
+--- a/tests/test_gdbus.py
++++ b/tests/test_gdbus.py
+@@ -284,76 +284,3 @@ class TestDBusConnection:
+ ):
+ reg_id = bus.register_object(**kwargs)
+ bus.unregister_object(reg_id)
+-
+- @unittest.skipUnless(has_dbus, "no dbus running")
+- def test_connection_invocation_ref_count(self):
+- """Invocation object should not leak a reference."""
+- invocation, errors = self.run_server(self.client_call)
+-
+- assert not errors
+- assert invocation
+- assert invocation.ref_count == 1
+-
+- def run_server(self, client_callback):
+- self.invocation = None
+- self.errors = []
+- self.loop = GLib.MainLoop()
+-
+- def on_name_acquired(bus, name):
+- client_callback(bus)
+-
+- self.reg_id = None
+- bus = Gio.bus_get_sync(Gio.BusType.SESSION)
+- owner_id = Gio.bus_own_name(Gio.BusType.SESSION,
+- "org.pygobject.Test",
+- Gio.BusNameOwnerFlags.NONE,
+- self.on_bus_acquired,
+- on_name_acquired,
+- self.on_name_lost)
+- try:
+- self.loop.run()
+- finally:
+- Gio.bus_unown_name(owner_id)
+- if self.reg_id:
+- bus.unregister_object(self.reg_id)
+-
+- return (self.invocation, self.errors)
+-
+- def on_name_lost(self, _bus, name):
+- self.errors.append(f"Name {name} lost")
+- self.loop.quit()
+-
+- def on_bus_acquired(self, bus, name):
+- interface_xml = """
+- <node>
+- <interface name='org.pygobject.Test'>
+- <method name='test' />
+- </interface>
+- </node>"""
+- self.reg_id = bus.register_object("/pygobject/Test",
+- Gio.DBusNodeInfo.new_for_xml(interface_xml).interfaces[0],
+- self.on_incoming_method_call,
+- None,
+- None)
+-
+- def on_incoming_method_call(self, bus, sender, object_path, interface_name, method_name, parameters, invocation):
+- invocation.return_value(GLib.Variant("()", ()))
+- self.invocation = invocation
+-
+- def client_call(self, bus):
+-
+- def call_done(obj, result):
+- try:
+- obj.call_finish(result)
+- finally:
+- self.loop.quit()
+-
+- bus.call("org.pygobject.Test",
+- "/pygobject/Test",
+- "org.pygobject.Test",
+- "test",
+- parameters=None,
+- reply_type=None,
+- flags=Gio.DBusCallFlags.NONE,
+- timeout_msec=5000,
+- callback=call_done)
+--
+2.47.0
+