From 033e97021e6654c9859776dedd9cd0504973f1d6 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 18 Jun 2019 09:46:05 -0400 Subject: xmleditor: Handle gtksourceview3 as well as gtksourceview4 API differences don't seem to affect our usage --- virtManager/xmleditor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'virtManager/xmleditor.py') diff --git a/virtManager/xmleditor.py b/virtManager/xmleditor.py index 9e55f83d..e58373ec 100644 --- a/virtManager/xmleditor.py +++ b/virtManager/xmleditor.py @@ -1,9 +1,16 @@ # This work is licensed under the GNU GPLv2 or later. # See the COPYING file in the top-level directory. +# pylint: disable=wrong-import-order,ungrouped-imports import gi -gi.require_version('GtkSource', '4') +# We can use either gtksourceview3 or gtksourceview4 +try: + gi.require_version("GtkSource", "4.0") + log.debug("Using GtkSource 4.0") +except ValueError: + gi.require_version("GtkSource", "3.0") + log.debug("Using GtkSource 3.0") from gi.repository import GtkSource from .lib import uiutil -- cgit v1.2.1