Remove sha256 file only if present.

This commit is contained in:
Cyryl Płotnicki-Chudyk 2016-05-08 10:00:36 +02:00
parent 15de207b9c
commit 6bce110c3e

View File

@ -33,11 +33,14 @@ def get(url, path, verbose=False):
print("moving " + temp_path + " to " + path)
shutil.move(temp_path, path)
finally:
print("removing " + sha_path)
os.unlink(sha_path)
if os.path.isfile(temp_path):
print("removing " + temp_path)
os.unlink(temp_path)
delete_if_present(sha_path)
delete_if_present(temp_path)
def delete_if_present(path):
if os.path.isfile(path):
print("removing " + path)
os.unlink(path)
def download(path, url, verbose):