Commit 23c2bbf5 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanups

parent bdc95095
......@@ -157,10 +157,11 @@ def report_error(err):
try: echo_file.write(line)
except UnicodeEncodeError:
echo_file.write(line.encode('ASCII', 'replace'))
num_errors = num_errors + 1
num_errors += 1
if Options.fast_fail:
raise AbortError("fatal errors")
def error(position, message):
#print "Errors.error:", repr(position), repr(message) ###
if position is None:
......@@ -170,7 +171,9 @@ def error(position, message):
report_error(err)
return err
LEVEL=1 # warn about all errors level 1 or higher
LEVEL = 1 # warn about all errors level 1 or higher
def message(position, message, level=1):
if level < LEVEL:
......@@ -183,6 +186,7 @@ def message(position, message, level=1):
echo_file.write(line)
return warn
def warning(position, message, level=0):
if level < LEVEL:
return
......@@ -196,6 +200,7 @@ def warning(position, message, level=0):
echo_file.write(line)
return warn
_warn_once_seen = {}
def warn_once(position, message, level=0):
if level < LEVEL or message in _warn_once_seen:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment