summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gi/overrides/GLib.py5
-rw-r--r--tests/test_glib.py7
2 files changed, 7 insertions, 5 deletions
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index fc38f69e..df5654ac 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -551,11 +551,6 @@ class Source(GLib.Source):
if hasattr(self, '__pygi_custom_source'):
self.unref()
- # Backwards compatible API for optional arguments
- def attach(self, context=None):
- id = super(Source, self).attach(context)
- return id
-
def set_callback(self, fn, user_data=None):
if hasattr(self, '__pygi_custom_source'):
# use our custom pyg_source_set_callback() if for a GSource object
diff --git a/tests/test_glib.py b/tests/test_glib.py
index 995d8471..f9e48536 100644
--- a/tests/test_glib.py
+++ b/tests/test_glib.py
@@ -229,3 +229,10 @@ https://my.org/q?x=1&y=2
def test_timezone_constructor_error(self):
self.assertRaisesRegexp(TypeError, '.*constructor.*help\(GLib.TimeZone\).*',
GLib.TimeZone)
+
+ def test_source_attach_implicit_context(self):
+ context = GLib.MainContext.default()
+ source = GLib.Idle()
+ source_id = source.attach()
+ self.assertEqual(context, source.get_context())
+ self.assertTrue(GLib.Source.remove(source_id))