Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, path):
self.path = path
self.success = True
self.errors = []
try:
self.tree = parse_xml(path)
except ElementTree.ParseError as ex:
self.tree = None
self.errors.append({
'file': self.path,
'line': ex.position[0],
'error': ex.msg,
})
self.rule_name = None