Skip to content

Commit eb13ae9

Browse files
committed
comments
Signed-off-by: laurentsimon <laurentsimon@google.com>
1 parent 3831c3d commit eb13ae9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sigstore/_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@ def key_id(key: PublicKey) -> KeyID:
164164

165165
return KeyID(hashlib.sha256(public_bytes).digest())
166166

167+
167168
def get_digest(input_: IO[bytes] | sigstore_hashes.Hashed) -> sigstore_hashes.Hashed:
168169
if isinstance(input_, sigstore_hashes.Hashed):
169170
return input_
170171

171-
# NOTE: Not able to check for the type `TypeError: Subscripted generics cannot be used with class and instance checks`
172-
# when calling isinstance(_input, IO[bytes])
173-
return sigstore_hashes.Hashed(digest=sha256_streaming(input_), algorithm=HashAlgorithm.SHA2_256)
172+
return sigstore_hashes.Hashed(
173+
digest=sha256_streaming(input_), algorithm=HashAlgorithm.SHA2_256
174+
)
175+
174176

175177
def sha256_streaming(io: IO[bytes]) -> bytes:
176178
"""

sigstore/hashes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright 2023 The Sigstore Authors
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)