summaryrefslogtreecommitdiff
path: root/xgps
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2017-11-02 13:16:47 -0700
committerGary E. Miller <gem@rellim.com>2017-11-02 13:16:47 -0700
commit74428c17803a757d568d128d00800a5848eea116 (patch)
tree6ed8574907081a274ef2e5bbc10bcb9191a1ef61 /xgps
parent2f6e5b674d63942d39d647dbe397f56824f2727d (diff)
downloadgpsd-74428c17803a757d568d128d00800a5848eea116.tar.gz
xgps: Print error message if Gtk3 not installed.
xgps was just crashing if Gtk2 is installed.
Diffstat (limited to 'xgps')
-rwxr-xr-xxgps8
1 files changed, 7 insertions, 1 deletions
diff --git a/xgps b/xgps
index 1a70aa90..78a08a0c 100755
--- a/xgps
+++ b/xgps
@@ -27,7 +27,13 @@ import cairo
# Gtk3 imports. Gtk3 requires the require_version(), which then causes
# pylint to complain about the subsequent "non-top" imports.
import gi
-gi.require_version('Gtk', '3.0')
+try:
+ gi.require_version('Gtk', '3.0')
+except:
+ # Gtk2 may be installed, has no equire_version()
+ sys.stderr.write("Unsupported Gtk version\n")
+ exit(1)
+
from gi.repository import GObject # pylint: disable=wrong-import-position
from gi.repository import Gtk # pylint: disable=wrong-import-position
from gi.repository import Gdk # pylint: disable=wrong-import-position