GNOME Bugzilla – Bug 705530
New style signals doesn't fully handle return_type
Last modified: 2013-08-05 21:18:29 UTC
The following test prints "None" instead of "True" as expected from gi.repository import GObject class Test(GObject.GObject): close = GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, return_type=GObject.TYPE_BOOLEAN) def close_cb(test): return True t = Test() t.close.connect(close_cb) print t.close.emit()
t.emit("close") works, so I think it's just a missing return here: https://git.gnome.org/browse/pygobject/tree/gi/_gobject/signalhelper.py#n102
The following fix has been pushed: 78f7265 Pass return values through the GObject.Signal.emit wrapper While looking at this I noticed the Signal decorator also does not support accumulators which I've logged as bug #705533
Created attachment 250903 [details] [review] Pass return values through the GObject.Signal.emit wrapper Return the result of GObject.emit from the Signal decorators wrapping. Update unittest for decorated return type to use skipUnless for Python 3. Add test for Signal decorator return type.