File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
src/model_signing/hashing Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -199,18 +199,18 @@ def compute(self) -> hashing.Digest:
199
199
digest = hashlib .file_digest (self ._fd , self ._algorithm )
200
200
# pytype: enable=wrong-arg-types
201
201
return hashing .Digest (self .digest_name , digest .digest ())
202
- else :
203
- # Polyfill for Python 3.10
204
- # See https://github.com/python/cpython/blob/4deb32a99292a3b1f6b773f6f96f1a8990a19fe0 /Lib/hashlib.py#L195-L238
205
- hasher = hashlib .new (self ._algorithm )
206
- buffer = bytearray (2 ** 18 )
207
- view = memoryview (buffer )
208
- while True :
209
- size = self ._fd .readinto (buffer )
210
- if size == 0 :
211
- break
212
- hasher .update (view [:size ])
213
- return hashing .Digest (self .digest_name , hasher .digest ())
202
+
203
+ # Polyfill for Python 3.10
204
+ # https://github.com/python/cpython/blob/4deb32a992 /Lib/hashlib.py#L195
205
+ hasher = hashlib .new (self ._algorithm )
206
+ buffer = bytearray (2 ** 18 )
207
+ view = memoryview (buffer )
208
+ while True :
209
+ size = self ._fd .readinto (buffer )
210
+ if size == 0 :
211
+ break
212
+ hasher .update (view [:size ])
213
+ return hashing .Digest (self .digest_name , hasher .digest ())
214
214
215
215
@property
216
216
@override
You can’t perform that action at this time.
0 commit comments