mirror of https://github.com/CIRCL/lookyloo
fix: remove broken pickles if needed
parent
4e69aa203f
commit
820c7c5a4d
|
@ -304,7 +304,10 @@ def load_pickle_tree(capture_dir: Path) -> Optional[CrawledTree]:
|
|||
pickle_file = capture_dir / 'tree.pickle'
|
||||
if pickle_file.exists():
|
||||
with pickle_file.open('rb') as _p:
|
||||
return pickle.load(_p)
|
||||
try:
|
||||
return pickle.load(_p)
|
||||
except pickle.UnpicklingError:
|
||||
remove_pickle_tree(capture_dir)
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue