Handle errors

This commit is contained in:
Sean C 2023-04-17 00:34:32 -04:00
parent d282e8d5d6
commit 76d8c4f01a

View File

@ -14,6 +14,7 @@ def quickhash(filefullpath):
return md5.digest()
except OSError as er:
print(f"Error hashing {filefullpath}")
return None
def direcCrawler():
global directories, files
@ -34,6 +35,7 @@ def calchashes():
filehashes = {}
for file in files:
hash = quickhash(file)
if hash = None: continue
## Inefficient to use a catch on every non-duplicate (most of the files)
try: filehashes[hash].append(file)
except: filehashes[hash] = [file]