summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Reiter <creiter@src.gnome.org>2015-05-30 15:46:54 (GMT)
committerChristoph Reiter <creiter@src.gnome.org>2015-05-31 14:06:51 (GMT)
commit7a3bb6971f22accd25e987496d377e1879f6e1ba (patch)
treefdf6b789e6fe8a523b529fef3e398ff4a1874715
parent64be2069d39b4d2767eb1efd47bb3f268ad7fb0d (diff)
downloadpygobject-7a3bb6971f22accd25e987496d377e1879f6e1ba.zip
pygobject-7a3bb6971f22accd25e987496d377e1879f6e1ba.tar.xz
Remove Gdk.Rectangle alias with newer gobject-introspection and GTK+
The new GdkRectangle in the typelib confuses the marshalling code as PyGObject uses the Python class from the overrides for marshalling to Python but uses the gtype from the typelib to do type checking when marshalling from Python. https://bugzilla.gnome.org/show_bug.cgi?id=749625
-rw-r--r--gi/overrides/Gdk.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index 15f2a0a..3ab5d6d 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -126,10 +126,14 @@ if Gdk._version == '2.0':
Rectangle = override(Rectangle)
__all__.append('Rectangle')
else:
- from gi.repository import cairo as _cairo
- Rectangle = _cairo.RectangleInt
-
- __all__.append('Rectangle')
+ # Newer GTK+/gobject-introspection (3.17.x) include GdkRectangle in the
+ # typelib. See https://bugzilla.gnome.org/show_bug.cgi?id=748832 and
+ # https://bugzilla.gnome.org/show_bug.cgi?id=748833
+ if not hasattr(Gdk, 'Rectangle'):
+ from gi.repository import cairo as _cairo
+ Rectangle = _cairo.RectangleInt
+
+ __all__.append('Rectangle')
if Gdk._version == '2.0':
class Drawable(Gdk.Drawable):