[gobject-introspection] [scanner] Make fatal warnings exit



commit edca95e1adf758342a106faec4d9769dab446d32
Author: Johan Dahlin <johan gnome org>
Date:   Tue Sep 7 11:34:32 2010 -0300

    [scanner] Make fatal warnings exit
    
    Even if warnings are not enabled

 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]