summaryrefslogtreecommitdiff
path: root/giscanner/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/message.py')
-rw-r--r--giscanner/message.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/giscanner/message.py b/giscanner/message.py
index 1f7195de..8a948cd3 100644
--- a/giscanner/message.py
+++ b/giscanner/message.py
@@ -90,7 +90,7 @@ class MessageLogger(object):
def log(self, log_type, text, positions=None, prefix=None):
"""Log a warning, using optional file positioning information.
-If the warning is related to a ast.Node type, see log_node_warning()."""
+If the warning is related to a ast.Node type, see log_node()."""
utils.break_on_debug_flag('warning')
self._warning_count += 1
@@ -123,8 +123,12 @@ If the warning is related to a ast.Node type, see log_node_warning()."""
'''%s: %s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name,
prefix, text))
else:
- text = (
+ if self._namespace:
+ text = (
'''%s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name, text))
+ else:
+ text = (
+'''%s: %s: %s\n''' % (last_position, error_type, text))
self._output.write(text)
if log_type == FATAL: