diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2021-10-19 19:49:14 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2021-10-21 13:51:31 +0200 |
commit | fe3b52cf1d80cf4c393ce3820172b7df4f31b84b (patch) | |
tree | 8103f356eb7c3da2c07b81b1f049368cb6287acc /grc/scripts/gnuradio-companion | |
parent | bb6c6b0c2047d1f61eaf05eb22339264591d6d31 (diff) |
GRC: be tolerant against Gtk.init_check failure, which seems to be flimsy
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
Diffstat (limited to 'grc/scripts/gnuradio-companion')
-rwxr-xr-x | grc/scripts/gnuradio-companion | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion index d0757e87ea..2f29974471 100755 --- a/grc/scripts/gnuradio-companion +++ b/grc/scripts/gnuradio-companion @@ -7,7 +7,6 @@ import os import sys -import warnings GR_IMPORT_ERROR_MESSAGE = """\ @@ -50,15 +49,20 @@ def die(error, message): def check_gtk(): try: - warnings.filterwarnings("error") import gi gi.require_version('Gtk', '3.0') gi.require_version('PangoCairo', '1.0') gi.require_foreign('cairo', 'Context') from gi.repository import Gtk - Gtk.init_check() - warnings.filterwarnings("always") + success = Gtk.init_check()[0] + if not success: + # Don't display a warning dialogue. This seems to be a Gtk bug. If it + # still can display warning dialogues, it does probably work! + print( + "Gtk init_check failed. GRC might not be able to start a GUI.", + file=sys.stderr) + except Exception as err: die(err, "Failed to initialize GTK. If you are running over ssh, " "did you enable X forwarding and start ssh with -X?") |