Skip to content

Commit 4499dc8

Browse files
spoorccben-edna
authored andcommitted
Minor typing fixes
1 parent ffdc5ee commit 4499dc8

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

dfetch/reporting/sbom_reporter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ def dump_to_file(self, outfile: str) -> bool:
114114
outputter = cast(Json, get_instance(bom=self._bom, output_format=output_format))
115115

116116
parsed = json.loads(outputter.output_as_string())
117-
outputter._json_output = (
118-
json.dumps( # pylint: disable=protected-access # type: ignore
119-
parsed, indent=4
120-
)
117+
outputter._json_output = ( # pylint: disable=protected-access # type: ignore
118+
json.dumps(parsed, indent=4)
121119
)
122120

123121
outputter.output_to_file(outfile, allow_overwrite=True)

dfetch/util/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from pathlib import Path
1010
from typing import Any, Generator, Iterator, List, Optional, Sequence, Union
1111

12+
from _hashlib import HASH
13+
1214

1315
def _remove_readonly(func: Any, path: str, _: Any) -> None:
1416
if not os.access(path, os.W_OK):
@@ -119,7 +121,7 @@ def hash_directory(path: str, skiplist: Optional[List[str]]) -> str:
119121
return digest.hexdigest()
120122

121123

122-
def hash_file(file_path: str, digest: "hashlib._Hash") -> "hashlib._Hash":
124+
def hash_file(file_path: str, digest: HASH) -> HASH:
123125
"""Hash the file at path."""
124126
if os.path.isfile(file_path):
125127
with open(file_path, "rb") as f_obj:

0 commit comments

Comments
 (0)