python: also delete partial file on KeyboardInterrupt/SystemExit (#2154)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2024-03-21 12:59:35 -04:00 committed by GitHub
parent 71d7f34d1a
commit 71db8bdc80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -362,7 +362,7 @@ class GPT4All:
bar.update(len(chunk))
if hsh.hexdigest() != expected_md5.lower():
raise ValueError(f"Expected MD5 hash of {expected_md5!r}, got {hsh.hexdigest()!r}")
except Exception:
except:
if verbose:
print("Cleaning up the interrupted download...", file=sys.stderr)
try: