mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Remove sha256 file only if present.
This commit is contained in:
parent
15de207b9c
commit
6bce110c3e
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user