From f009c7a1f5c06eae91abdfc0724b5ecf230a81c0 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 23 Dec 2010 15:10:55 +0000 Subject: [PATCH] Check to see if gtk is valid; 'import gtk' used to raise an exception, now init_check does (should return boolean - pygtk bug reported #637877) svn: r16306 --- src/gui/grampsgui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/grampsgui.py b/src/gui/grampsgui.py index cc457e0ce..5008fcb4b 100644 --- a/src/gui/grampsgui.py +++ b/src/gui/grampsgui.py @@ -283,6 +283,7 @@ def __startgramps(errors, argparser): try: quit_now = False exit_code = 0 + gtk.init_check() Gramps(argparser) except SystemExit, e: @@ -300,6 +301,13 @@ def __startgramps(errors, argparser): fn = "" LOG.error("Gramps terminated because of OS Error\n" + "Error details: %s %s" % (repr(e), fn), exc_info=True) + + except RuntimeError, e: + quit_now = True + exit_code = e[0] or 1 + print("Gramps terminated because of no DISPLAY") + sys.exit(exit_code) + except: quit_now = True exit_code = 1