From 80db6ef0d55536e3d148011334f130910891c72b Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Wed, 17 Jul 2024 13:23:51 -0700 Subject: [PATCH] Fix typos, add a type signature Signed-off-by: Mihai Maruseac --- model_signing/serialization/serialize_by_file.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/model_signing/serialization/serialize_by_file.py b/model_signing/serialization/serialize_by_file.py index 4d31ddd4..19d54083 100644 --- a/model_signing/serialization/serialize_by_file.py +++ b/model_signing/serialization/serialize_by_file.py @@ -185,9 +185,7 @@ class _FileDigestTree: Every leaf in the tree is a file, paired with its digest. Every intermediate node represents a directory. We need to pair every directory with a digest, - in a top-down fashion. - - Every internal node has a list of children, sorted alphabetically. + in a bottom-up fashion. """ def __init__( @@ -211,7 +209,7 @@ def build_tree( cls, items: Iterable[manifest.FileManifestItem] ) -> "_FileDigestTree": """Builds a tree out of the sequence of manifest items.""" - path_to_node = {} + path_to_node: dict[pathlib.PurePath, _FileDigestTree] = {} for file_item in items: file = file_item.path