[pygobject] overrides: Remove GLib.Source.attach



commit f114edc0a0afa64077a13459034afc4255b7a3f1
Author: Simon Feltman <sfeltman src gnome org>
Date:   Mon Jan 6 22:10:47 2014 -0800

    overrides: Remove GLib.Source.attach
    
    Remove GLib.Source.attach override now that tail end allow-none arguments
    default to None when not specified.

 gi/overrides/GLib.py |    5 -----
 tests/test_glib.py   |    7 +++++++
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index fc38f69..df5654a 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 995d847..f9e4853 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))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]