diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-07 11:34:32 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-07 11:34:59 -0300 |
commit | edca95e1adf758342a106faec4d9769dab446d32 (patch) | |
tree | 5ba8db6ab9cd0722564fed974031a27632391ea3 /giscanner | |
parent | 10188b59ff93be814798f657a70a447419acff57 (diff) |
[scanner] Make fatal warnings exit
Even if warnings are not enabled
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/message.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/giscanner/message.py b/giscanner/message.py index a522b75..b037e54 100644 --- a/giscanner/message.py +++ b/giscanner/message.py @@ -60,6 +60,8 @@ If the warning is related to a ast.Node type, see log_node_warning().""" utils.break_on_debug_flag('warning') if not self._enable_warnings: + if log_type == FATAL: + raise SystemExit(text) return self._warned = True @@ -92,15 +94,16 @@ If the warning is related to a ast.Node type, see log_node_warning().""" elif log_type == FATAL: error_type = "Fatal" if prefix: - self._output.write( + text = ( '''%s: %s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name, prefix, text)) else: - self._output.write( + text = ( '''%s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name, text)) + self._output.write(text) if log_type == FATAL: - raise SystemExit(1) + raise SystemExit(text) def log_node(self, log_type, node, text, context=None): """Log a warning, using information about file positions from @@ -158,4 +161,3 @@ def warn_symbol(symbol, text): def fatal(text, file_positions=None, prefix=None): ml = MessageLogger.get() ml.log(FATAL, text, file_positions, prefix) - raise SystemExit |