mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
Use default backend instead of None
Set the `backend` variable to the default backend by default instead to `None`. The `backend` variable is needed in Python 2 as `args.backend` is only set in Python 3. Although the value of the backend variable is ignored in Python 2, so that the default value is not used. Co-authored-by: William Ballenthin <william.ballenthin@fireeye.com>
This commit is contained in:
@@ -285,7 +285,7 @@ def main(argv=None):
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
backend = args.backend if sys.version_info > (3, 0) else None
|
||||
backend = args.backend if sys.version_info > (3, 0) else capa.main.BACKEND_VIV
|
||||
extractor = capa.main.get_extractor(args.sample, args.format, backend)
|
||||
with open(args.output, "wb") as f:
|
||||
f.write(dump(extractor))
|
||||
|
||||
@@ -630,7 +630,7 @@ def main(argv=None):
|
||||
else:
|
||||
format = args.format
|
||||
try:
|
||||
backend = args.backend if sys.version_info > (3, 0) else None
|
||||
backend = args.backend if sys.version_info > (3, 0) else capa.main.BACKEND_VIV
|
||||
extractor = get_extractor(args.sample, args.format, backend, disable_progress=args.quiet)
|
||||
except UnsupportedFormatError:
|
||||
logger.error("-" * 80)
|
||||
|
||||
Reference in New Issue
Block a user