fix mypy and codestyle issues

This commit is contained in:
Yacine Elhamer
2023-06-27 11:32:21 +01:00
parent a99ff813cb
commit 06aea6b97c
3 changed files with 3 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ class CapeExtractor(DynamicFeatureExtractor):
self.behavior = behavior
self.global_features = capa.features.extractors.cape.global_.extract_features(self.static)
def extract_global_features(self) -> Iterator[Tuple[Feature, Address]]:
yield from self.global_features

View File

@@ -21,7 +21,7 @@ import textwrap
import itertools
import contextlib
import collections
from typing import Any, Dict, List, Tuple, Callable, cast, Union
from typing import Any, Dict, List, Tuple, Union, Callable, cast
import halo
import tqdm
@@ -786,6 +786,7 @@ def collect_metadata(
sha1 = hashlib.sha1()
sha256 = hashlib.sha256()
assert isinstance(extractor, StaticFeatureExtractor)
with open(sample_path, "rb") as f:
buf = f.read()

View File

@@ -84,7 +84,6 @@ from capa.helpers import get_auto_format, log_unsupported_runtime_error
from capa.features.common import FORMAT_AUTO, FORMAT_FREEZE, DYNAMIC_FORMATS, is_global_feature
from capa.features.extractors.base_extractor import FeatureExtractor, StaticFeatureExtractor, DynamicFeatureExtractor
logger = logging.getLogger("capa.show-features")