Skip to content

Commit b9d98bb

Browse files
author
Fabien Coelho
committed
please pyright
1 parent 60d3e08 commit b9d98bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CacheToolsUtils.py

+2
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ def __getitem__(self, key):
421421
xval = self._cache[hkey]
422422
if self._csize: # split cs from encrypted value
423423
cs, xval = xval[:self._csize], xval[self._csize:]
424+
else:
425+
cs = None
424426
val = self._cipher.new(key=vkey, nonce=vnonce).decrypt(xval)
425427
if self._csize and cs != hashlib.sha3_256(val).digest()[:self._csize]:
426428
raise KeyError(f"invalid encrypted value for key {key}")

0 commit comments

Comments
 (0)