commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 03/09: gnuradio-companion: Exit if gtk impo


From: git
Subject: [Commit-gnuradio] [gnuradio] 03/09: gnuradio-companion: Exit if gtk import fails.
Date: Mon, 6 Jul 2015 23:36:59 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 36a6844c9d2cefaea9d892fe278f0e3317d79dae
Author: Philip Balister <address@hidden>
Date:   Wed Jun 24 18:49:03 2015 -0400

    gnuradio-companion: Exit if gtk import fails.
    
    One known cause is missing X server.
    
    Signed-off-by: Philip Balister <address@hidden>
---
 grc/scripts/gnuradio-companion | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion
index 7a407ea..6b7a829 100755
--- a/grc/scripts/gnuradio-companion
+++ b/grc/scripts/gnuradio-companion
@@ -21,11 +21,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
MA  02110-1301, USA
 import os
 import sys
 import optparse
+import warnings
 
 import pygtk
 pygtk.require('2.0')
-import gtk
 
+warnings.filterwarnings("error")
+try:
+    import gtk
+except:
+    sys.exit("Failed to import gtk. If you are running over ssh, did you 
enable X forwarding and start ssh with -X?")
+warnings.filterwarnings("always")
 
 GR_IMPORT_ERROR_MESSAGE = """\
 Cannot import gnuradio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]