- Warnings should not cause the output to be ignored

This commit is contained in:
ccremers 2007-01-12 10:02:56 +00:00
parent 36edcc91fb
commit d8da0a083f

View File

@ -121,6 +121,7 @@ class Scyther(object):
self.claims = None self.claims = None
self.errors = None self.errors = None
self.errorcount = 0 self.errorcount = 0
self.warnings = None
self.run = False self.run = False
self.output = None self.output = None
self.cmd = None self.cmd = None
@ -239,11 +240,21 @@ class Scyther(object):
# process errors # process errors
self.errors = [] self.errors = []
self.warnings = []
for l in errors.splitlines(): for l in errors.splitlines():
line = l.strip()
# filter out any non-errors (say maybe only claim etc) and count # filter out any non-errors (say maybe only claim etc) and count
# them. # them.
if not l.startswith("claim\t"): if line.startswith("claim\t"):
self.errors.append(l.strip()) # Claims are lost, reconstructed from the XML output
continue
if line.startswith("warning"):
# Warnings are stored seperately
self.warnings.append(line)
continue
# otherwise it is an error
self.errors.append(line)
self.errorcount = len(self.errors) self.errorcount = len(self.errors)
# process output # process output