From: <go...@us...> - 2005-12-07 14:31:50
|
Author: goodger Date: 2005-12-07 15:30:56 +0100 (Wed, 07 Dec 2005) New Revision: 4150 Modified: trunk/docutils/docutils/core.py Log: don't catch SystemExit exceptions Modified: trunk/docutils/docutils/core.py =================================================================== --- trunk/docutils/docutils/core.py 2005-12-06 01:07:49 UTC (rev 4149) +++ trunk/docutils/docutils/core.py 2005-12-07 14:30:56 UTC (rev 4150) @@ -194,6 +194,7 @@ `self.writer`'s output. """ exit = None + exit_status = 0 try: if self.settings is None: self.process_command_line( @@ -205,6 +206,8 @@ self.apply_transforms() output = self.writer.write(self.document, self.destination) self.writer.assemble_parts() + except SystemExit: + exit = 1 except Exception, error: if self.settings and self.settings.traceback: # propagate exceptions? @@ -212,13 +215,14 @@ raise self.report_Exception(error) exit = 1 + exit_status = 1 self.debugging_dumps() if (enable_exit_status and self.document and (self.document.reporter.max_level >= self.settings.exit_status_level)): sys.exit(self.document.reporter.max_level + 10) elif exit: - sys.exit(1) + sys.exit(exit_status) return output def debugging_dumps(self): |