From 88adb38a4241aa5423a9cefae9b4b11305bb61c5 Mon Sep 17 00:00:00 2001 From: James Cameron Date: Fri, 27 Dec 2019 20:23:34 +1100 Subject: [PATCH] Fix RuntimeError: could not create signal for _closing On Ubuntu 20.04 with GTK 3.24.13, importing sugar3.activity.activity fails with RuntimeError: could not create signal for _closing, preceeded by an assertion is_valid_signal_name failed. Cause is upstream 89f955d ("gsignal: Canonicalise signal names at installation time ") which requires application signal names to not start with a hyphen or underscore. Remove the prefix from our signal name. The signal remains reserved and private to the Activity class. --- src/sugar3/activity/activity.py | 4 ++-- src/sugar3/activity/widgets.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py index 08dd2e6a..3ad4a44f 100644 --- a/src/sugar3/activity/activity.py +++ b/src/sugar3/activity/activity.py @@ -328,7 +328,7 @@ class Activity(Window, Gtk.Container): 'joined': (GObject.SignalFlags.RUN_FIRST, None, ([])), # For internal use only, use can_close() if you want to perform extra # checks before actually closing - '_closing': (GObject.SignalFlags.RUN_FIRST, None, ([])), + 'closing': (GObject.SignalFlags.RUN_FIRST, None, ([])), } def __init__(self, handle, create_jobject=True): @@ -1301,7 +1301,7 @@ class Activity(Window, Gtk.Container): def _do_close(self, skip_save): self.busy() - self.emit('_closing') + self.emit('closing') if not self._closing: if not self._prepare_close(skip_save): return diff --git a/src/sugar3/activity/widgets.py b/src/sugar3/activity/widgets.py index 57223f4b..7982489e 100644 --- a/src/sugar3/activity/widgets.py +++ b/src/sugar3/activity/widgets.py @@ -189,7 +189,7 @@ class TitleEntry(Gtk.ToolItem): self.add(self.entry) activity.metadata.connect('updated', self.__jobject_updated_cb) - activity.connect('_closing', self.__closing_cb) + activity.connect('closing', self.__closing_cb) def __activate_cb(self, entry, activity): self.save_title(activity)