After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642387 - Preserve code path for static bindings that don't use introspection.
Preserve code path for static bindings that don't use introspection.
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-15 15:34 UTC by Laszlo Pandy
Modified: 2011-02-15 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[GI] Remove implicit loading of gi module preserve the code path for static bindings. (1.68 KB, patch)
2011-02-15 15:34 UTC, Laszlo Pandy
accepted-commit_now Details | Review

Description Laszlo Pandy 2011-02-15 15:34:51 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.
Comment 1 Laszlo Pandy 2011-02-15 15:34:53 UTC
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 2 johnp 2011-02-15 15:39:51 UTC
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.