From e41160bb3e29380b27b16ed84d95798890b6965e Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 17 Jun 2007 01:20:09 +0000 Subject: [PATCH] * src/gramps.py (run): Catch SystemExit exception. svn: r8568 --- gramps2/ChangeLog | 1 + gramps2/src/ArgHandler.py | 2 +- gramps2/src/gramps.py | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0ee9de7f4..7bf8b9b0b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2007-06-16 Alex Roitman + * src/gramps.py (run): Catch SystemExit exception. * src/ArgHandler.py: Use sys.exit() for bailing out. * src/GrampsDb/_ReadXML.py (start_url): Correctly parse url type; Use sys.ext() for bailing out. diff --git a/gramps2/src/ArgHandler.py b/gramps2/src/ArgHandler.py index 5bea4b9c3..2a05ae03b 100644 --- a/gramps2/src/ArgHandler.py +++ b/gramps2/src/ArgHandler.py @@ -469,7 +469,7 @@ class ArgHandler: GrampsDb.gramps_db_reader_factory(const.app_gramps_xml)( self.state.db,filename,None,self.cl) except: - msg "Error importing %s" % filename + msg = "Error importing %s" % filename sys.exit(msg) elif format == 'geneweb': import ImportGeneWeb diff --git a/gramps2/src/gramps.py b/gramps2/src/gramps.py index 00cbe16e0..a5e9cfc92 100644 --- a/gramps2/src/gramps.py +++ b/gramps2/src/gramps.py @@ -170,6 +170,9 @@ def run(): try: gramps_main.Gramps(args) + except SystemExit, msg: + log.error("Gramps terminated with the following message:\n %s." + % msg, exc_info=True) except: log.error("Gramps failed to start.", exc_info=True)