From d2fc7402784d17ccbb70a33c51755347ca9bb0dd Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Mon, 3 Apr 2023 13:44:09 +0200 Subject: [PATCH] result document: mypy --- capa/render/result_document.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/capa/render/result_document.py b/capa/render/result_document.py index cba62258..2d2d10f4 100644 --- a/capa/render/result_document.py +++ b/capa/render/result_document.py @@ -581,7 +581,7 @@ class ResultDocument(FrozenModel): def to_capa(self) -> Tuple[Dict, Dict]: meta = self.meta.to_capa() - capabilities: Dict[str, List[Tuple[frz.Address, capa.features.common.Result]]] = {} + capabilities: Dict[str, List[Tuple[capa.features.address.Address, capa.features.common.Result]]] = {} for rule_name, rule_match in self.rules.items(): # Parse the YAML source into a Rule instance @@ -604,12 +604,12 @@ class ResultDocument(FrozenModel): result = capa.features.common.Result( statement=statement, success=match.success, - locations=[frz.Address.to_capa(loc) for loc in match.locations], + locations={loc.to_capa() for loc in match.locations}, children=[], ) if rule_name not in capabilities: capabilities[rule_name] = [] - capabilities[rule_name].append((frz.Address.from_capa(addr), result)) + capabilities[rule_name].append((addr.to_capa(), result)) return meta, capabilities