fix TypeAlias importing: import from typing_extensions to support Python 3.9 and lower

This commit is contained in:
Yacine Elhamer
2023-06-26 21:14:17 +01:00
parent c74c8871f8
commit 63e4d3d5eb
3 changed files with 10 additions and 13 deletions

View File

@@ -46,7 +46,7 @@ import capa.helpers
import capa.features
import capa.features.common
import capa.features.freeze
from capa.features.extractors.base_extractor import FeatureExtractor
from capa.features.extractors.base_extractor import StaticFeatureExtractor
logger = logging.getLogger("capa.profile")
@@ -105,8 +105,9 @@ def main(argv=None):
):
with open(args.sample, "rb") as f:
extractor = capa.features.freeze.load(f.read())
assert isinstance(extractor, StaticFeatureExtractor)
else:
extractor: FeatureExtractor = capa.main.get_extractor(
extractor = capa.main.get_extractor(
args.sample, args.format, args.os, capa.main.BACKEND_VIV, sig_paths, should_save_workspace=False
)