virt-manager: Enforce gobject introspection versions

This is needed with freebsd and opensuse at least. See:

https://bugzilla.suse.com/__show_bug.cgi?id=901869
http://www.redhat.com/archives/libvir-list/2014-December/msg00184.html
This commit is contained in:
Cole Robinson 2014-12-02 14:01:28 -05:00
parent d2e6271337
commit 0b391fe9ed
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import signal
import sys
import traceback
import gi
from gi.repository import GObject
from gi.repository import LibvirtGLib
@ -42,7 +43,6 @@ warnings.simplefilter("ignore")
try:
# Avoid a deprecation warning about threads_init
import gi
gi.check_version("3.9.1")
except (ValueError, AttributeError):
GObject.threads_init()
@ -177,6 +177,7 @@ def main():
origargv = sys.argv
try:
sys.argv = origargv[:1] + leftovers[:]
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
leftovers = sys.argv[1:]

View File

@ -20,10 +20,13 @@
# MA 02110-1301 USA.
#
import gi
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
gi.require_version('GtkVnc', '2.0')
from gi.repository import GtkVnc
gi.require_version('SpiceClientGtk', '3.0')
from gi.repository import SpiceClientGtk
from gi.repository import SpiceClientGLib