diff options
author | Gary E. Miller <gem@rellim.com> | 2017-11-02 13:16:47 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2017-11-02 13:16:47 -0700 |
commit | 74428c17803a757d568d128d00800a5848eea116 (patch) | |
tree | 6ed8574907081a274ef2e5bbc10bcb9191a1ef61 /xgps | |
parent | 2f6e5b674d63942d39d647dbe397f56824f2727d (diff) | |
download | gpsd-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-x | xgps | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |