Merge lp:~pitti/ubuntu-sso-client/gi-fixes into lp:ubuntu-sso-client

Proposed by Martin Pitt
Status: Merged
Approved by: Natalia Bidart
Approved revision: 766
Merged at revision: 763
Proposed branch: lp:~pitti/ubuntu-sso-client/gi-fixes
Merge into: lp:ubuntu-sso-client
Diff against target: 24 lines (+8/-2)
1 file modified
ubuntu_sso/utils/txsecrets.py (+8/-2)
To merge this branch: bzr merge lp:~pitti/ubuntu-sso-client/gi-fixes
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+72527@code.launchpad.net

Commit message

- Do not mix static with gi bindings (LP: #829186).

Description of the change

pygobject >= 2.90 is now absolutely zero tolerant against importing both the
static and the GI version of a particular library. This was mostly the case
with 2.28 as well, but did work in some cases (like "import gobject; from
gi.repository import Gtk", in particular for "glib" and "gobject"). These now
cause errors as well.

With this fix we can use the library from both programs with static bindings
(gobject, gtk), as well as from programs which use the gobject-introspection
bindings.

See bug 829186 for more details.

This is a dependency of
https://code.launchpad.net/~pitti/ubuntuone-client/gi-fixes/+merge/72447

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Hi Martin!

The branch looks great, I'm approving. In order to have this branch being landed by tarmac (our bot lander), we'll need that the test run (triggered by ./run-tests) reports no lint errors. ATM, in natty, I'm getting this:

ubuntu_sso/utils/txsecrets.py:
    28: [E0611] No name 'GObject' in module 'gi.repository'

You need to wrap the from gi.repository import GObject like this:

else:
    # pylint: disable=E0611
    from gi.repository import GObject
    # pylint: enable=E0611

review: Approve
lp:~pitti/ubuntu-sso-client/gi-fixes updated
764. By Martin Pitt

add necessary pylint tags

765. By Martin Pitt

fix pylint tags

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Thanks for the fixes!

For some reason I can't debug right now, lint will not be happy unless I change the disables to something like this:

     25 # pylint: disable=E0611
     26 if 'gobject' in sys.modules:
     27 import gobject as GObject
     28 else:
     29 from gi.repository import GObject
     30 # pylint: enable=E0611

would you please perform this last change? Thanks!

lp:~pitti/ubuntu-sso-client/gi-fixes updated
766. By Martin Pitt

update pylint markers again as per Natalia's request

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu_sso/utils/txsecrets.py'
--- ubuntu_sso/utils/txsecrets.py 2011-07-05 15:26:05 +0000
+++ ubuntu_sso/utils/txsecrets.py 2011-08-23 12:16:24 +0000
@@ -21,13 +21,19 @@
21 * http://code.confuego.org/secrets-xdg-specs/21 * http://code.confuego.org/secrets-xdg-specs/
22"""22"""
2323
24import gobject24import sys
25# pylint: disable=E0611
26if 'gobject' in sys.modules:
27 import gobject as GObject
28else:
29 from gi.repository import GObject
30# pylint: enable=E0611
25import dbus31import dbus
26from dbus.mainloop.glib import DBusGMainLoop32from dbus.mainloop.glib import DBusGMainLoop
27import dbus.mainloop.glib33import dbus.mainloop.glib
28from twisted.internet.defer import Deferred34from twisted.internet.defer import Deferred
2935
30gobject.threads_init()36GObject.threads_init()
31dbus.mainloop.glib.threads_init()37dbus.mainloop.glib.threads_init()
32DBusGMainLoop(set_as_default=True)38DBusGMainLoop(set_as_default=True)
3339

Subscribers

People subscribed via source and target branches