## Description: fix import of GLib and GObject
## Author: Carlo Vanini <silhusk@gmail.com>
## Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579834
## Last-Update: 2016-07-07
Index: apt-xapian-index-0.47ubuntu9/tests/dbus-update-apt-xapian-index.py
===================================================================
--- apt-xapian-index-0.47ubuntu9.orig/tests/dbus-update-apt-xapian-index.py
+++ apt-xapian-index-0.47ubuntu9/tests/dbus-update-apt-xapian-index.py
@@ -4,7 +4,10 @@ from __future__ import print_function
 
 import dbus
 import os
-import glib
+try:
+	from gi.repository import GLib as glib
+except ImportError:
+	import glib
 import dbus.mainloop.glib
 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
Index: apt-xapian-index-0.47ubuntu9/update-apt-xapian-index-dbus
===================================================================
--- apt-xapian-index-0.47ubuntu9.orig/update-apt-xapian-index-dbus
+++ apt-xapian-index-0.47ubuntu9/update-apt-xapian-index-dbus
@@ -6,8 +6,14 @@ import string
 import subprocess
 
 try:
-    import glib
-    import gobject
+    try:
+        from gi.repository import GLib as glib
+    except ImportError:
+        import glib
+    try:
+        from gi.repository import GObject as gobject
+    except ImportError:
+        import gobject
     import dbus
     import dbus.service
     import dbus.mainloop.glib
