code style : update remaining files (#1353)

* code style: update string formatting using fstrings

---------

Co-authored-by: Willi Ballenthin <willi.ballenthin@gmail.com>
Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
This commit is contained in:
manasghandat
2023-03-16 15:46:18 +05:30
committed by GitHub
parent 8cf74759a6
commit 1336796c0c
35 changed files with 201 additions and 227 deletions

View File

@@ -112,7 +112,7 @@ def get_capa_results(args):
return {
"path": path,
"status": "error",
"error": "input file does not appear to be a PE file: %s" % path,
"error": f"input file does not appear to be a PE file: {path}",
}
except capa.main.UnsupportedRuntimeError:
return {
@@ -124,7 +124,7 @@ def get_capa_results(args):
return {
"path": path,
"status": "error",
"error": "unexpected error: %s" % (e),
"error": f"unexpected error: {e}",
}
meta = capa.main.collect_metadata([], path, [], extractor)
@@ -202,7 +202,7 @@ def main(argv=None):
elif result["status"] == "ok":
results[result["path"]] = rd.ResultDocument.parse_obj(result["ok"]).json(exclude_none=True)
else:
raise ValueError("unexpected status: %s" % (result["status"]))
raise ValueError(f"unexpected status: {result['status']}")
print(json.dumps(results))