summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-07 11:34:32 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-07 11:34:59 -0300
commitedca95e1adf758342a106faec4d9769dab446d32 (patch)
tree5ba8db6ab9cd0722564fed974031a27632391ea3
parent10188b59ff93be814798f657a70a447419acff57 (diff)
downloadgobject-introspection-edca95e1adf758342a106faec4d9769dab446d32.tar.gz
[scanner] Make fatal warnings exit
Even if warnings are not enabled
-rw-r--r--giscanner/message.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/giscanner/message.py b/giscanner/message.py
index a522b75c..b037e542 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