Comment 3 for bug 885732

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

A workaround is to change importing order:

>>> import gnomekeyring
>>> from gi.repository import Gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))

--------

>>> from gi.repository import Gtk
>>> import gnomekeyring
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject

In this way we don't get crash, only a warning message.