summaryrefslogtreecommitdiff
path: root/virtManager/xmleditor.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-06-18 09:46:05 -0400
committerCole Robinson <crobinso@redhat.com>2019-06-18 09:54:58 -0400
commit033e97021e6654c9859776dedd9cd0504973f1d6 (patch)
tree582d63cc108abc4953ed3b17e1372c2a32ae8fb9 /virtManager/xmleditor.py
parentb6563b90e55c2d45dd28a2acfb11a70cd7ed777d (diff)
downloadvirt-manager-033e97021e6654c9859776dedd9cd0504973f1d6.tar.gz
xmleditor: Handle gtksourceview3 as well as gtksourceview4
API differences don't seem to affect our usage
Diffstat (limited to 'virtManager/xmleditor.py')
-rw-r--r--virtManager/xmleditor.py9
1 files changed, 8 insertions, 1 deletions
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