summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-01-06 22:10:47 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2014-01-06 22:10:47 -0800
commitf114edc0a0afa64077a13459034afc4255b7a3f1 (patch)
tree895e2ae351a94ba91506ea0ff003dc346ed94c33
parent50ab6a8b70cbe7b67fc8d804b7773bb2c9b47251 (diff)
downloadpygobject-f114edc0a0afa64077a13459034afc4255b7a3f1.tar.gz
overrides: Remove GLib.Source.attach
Remove GLib.Source.attach override now that tail end allow-none arguments default to None when not specified.
-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))