GNOME Bugzilla – Bug 642387
Preserve code path for static bindings that don't use introspection.
Last modified: 2011-02-15 20:04:24 UTC
Currently code written for the old static bindings pulls in the gi module because of the hooks in pygobject for introspection types. This risks breaking ABI for apps expecting to reply on the old static bindings.
Created attachment 180903 [details] [review] [GI] Remove implicit loading of gi module preserve the code path for static bindings. Previously type lookups (as well as property accesses and signal connects would trigger an import of the gi module). Now we make those paths fail, and fallback to the old static binding code paths *unless* the gi module is already in sys.modules. So if Python code calls: from gi.repository import Gtk or even just: import gi then everything will work just like it did without this patch. If gi is not explicitly imported, the code skips the introspection code and acts like the old static bindings did.
Comment on attachment 180903 [details] [review] [GI] Remove implicit loading of gi module preserve the code path for static bindings. Looks good. Only commit to the 2-28 branch as we don't need this in master.