pydantic: remove use of deprecated routines

closes #1718
This commit is contained in:
Willi Ballenthin
2023-08-15 08:41:56 +00:00
committed by GitHub
parent 408c5076c6
commit e6d64ef561
8 changed files with 17 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ See the License for the specific language governing permissions and limitations
"""
import logging
import binascii
from pathlib import Path
import ida_nalt
import ida_funcs
@@ -68,7 +69,7 @@ def main():
if not path:
return 0
result_doc = capa.render.result_document.ResultDocument.parse_file(path)
result_doc = capa.render.result_document.ResultDocument.from_file(Path(path))
meta, capabilities = result_doc.to_capa()
# in IDA 7.4, the MD5 hash may be truncated, for example:

View File

@@ -31,6 +31,7 @@ Example:
import sys
import logging
import argparse
from pathlib import Path
import capa.render.proto
import capa.render.result_document
@@ -64,7 +65,7 @@ def main(argv=None):
logging.basicConfig(level=logging.INFO)
logging.getLogger().setLevel(logging.INFO)
rd = capa.render.result_document.ResultDocument.parse_file(args.json)
rd = capa.render.result_document.ResultDocument.from_file(Path(args.json))
pb = capa.render.proto.doc_to_pb2(rd)
sys.stdout.buffer.write(pb.SerializeToString(deterministic=True))