GNOME Bugzilla – Bug 702787
Remove lines form pygtkcompat.py that broke GTK3 pygi scripts
Last modified: 2013-06-21 05:29:42 UTC
Created attachment 247404 [details] [review] Remove lines that prevented GTK3 pygi scripts running Hi, As I was attempting to run the gtk-demo PyGI program on Windows that is taken from the PyGObject git checkout, it seems that the following lines: Gdk.pixbuf_new_from_file_at_scale = GdkPixbuf.Pixbuf.new_from_file_at_scale (line 142) and Gtk.clipboard_get = Gtk.Clipboard.get (line 352) prevented the demo GTK3 pygi scripts from running with error messages such as: AttributeError: type object 'Pixbuf' has no attribute 'new_from_file_at_scale' AttributeError: type object 'Clipboard' has no attribute 'get' which leads me to believe that there were some changes in PyGObject that necessitated this change, at least that was the case for me on Windows, but I think it might hit other platforms as well. So, here's the patch to remove those offending lines. With blessings, Thank you!
These are backwards compatibility declarations for old method names that pygtk offered. gdk_pixbuf_new_from_file_at_scale() was introduced in gdk-pixbuf 2.6, so maybe you have an older version? It's certainly there for me in /usr/share/gir-1.0/GdkPixbuf-2.0.gir Likewise, /usr/share/gir-1.0/Gtk-3.0.gir has gtk_clipboard_get(), but perhaps that doesn't exist on Windows. So I'll make these two conditional instead, as they are required on Linux.
Fixed in https://git.gnome.org/browse/pygobject/commit/?id=61b268e44 Thanks!