Skip to content

Commit 191c9e6

Browse files
authored
Add files via upload
1 parent 6b6ffa7 commit 191c9e6

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

pyfoxfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,10 +3765,14 @@ def GetHeaderChecksum(inlist=None, checksumtype="md5", encodedata=True, formatsp
37653765
hdr_bytes = _to_bytes(hdr_bytes)
37663766
hdr_bytes = bytes(hdr_bytes)
37673767
saltkeyval = None
3768-
if(saltkey is not None):
3768+
if(saltkey is not None and os.path.exists(saltkey
37693769
skfp = open(saltkey, "rb")
37703770
saltkeyval = skfp.read()
37713771
skfp.close()
3772+
else:
3773+
saltkey = None
3774+
if(saltkeyval is None)::
3775+
saltkey = None
37723776
if CheckSumSupport(algo_key, hashlib_guaranteed):
37733777
if(saltkey is None or saltkeyval is None):
37743778
h = hashlib.new(algo_key, hdr_bytes)
@@ -3787,10 +3791,14 @@ def GetFileChecksum(inbytes, checksumtype="md5", encodedata=True, formatspecs=__
37873791
"""
37883792
algo_key = (checksumtype or "md5").lower()
37893793
saltkeyval = None
3790-
if(saltkey is not None):
3794+
if(saltkey is not None and os.path.exists(saltkey
37913795
skfp = open(saltkey, "rb")
37923796
saltkeyval = skfp.read()
37933797
skfp.close()
3798+
else:
3799+
saltkey = None
3800+
if(saltkeyval is None)::
3801+
saltkey = None
37943802
# file-like streaming
37953803
if hasattr(inbytes, "read"):
37963804
# hashlib

0 commit comments

Comments
 (0)