~vorlon/aptdaemon/lp.1034806

Viewing all changes in revision 848.

  • Committer: Martin Pitt
  • Date: 2012-07-12 14:08:43 UTC
  • Revision ID: martin.pitt@ubuntu.com-20120712140843-7s51u31ero7hqsjn
aptdaemon/client.py: Prefer GI GObject module

If 'gobject' is not available (such as in Python 3), but this module gets
imported before importing any gi.repository module, aptdaemon crashes with

Traceback (most recent call last):
  File "./software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/home/martin/ubuntu/software-properties-additional-drivers/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 34, in <module>
    from aptdaemon import client
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 43, in <module>
    import gobject as GObject
ImportError: No module named gobject

Fix this by swapping the order around and only using gobject if it is already imported.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: