Skip to content

Commit 6bce110

Browse files
committed
Remove sha256 file only if present.
1 parent 15de207 commit 6bce110

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/bootstrap/bootstrap.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ def get(url, path, verbose=False):
3333
print("moving " + temp_path + " to " + path)
3434
shutil.move(temp_path, path)
3535
finally:
36-
print("removing " + sha_path)
37-
os.unlink(sha_path)
38-
if os.path.isfile(temp_path):
39-
print("removing " + temp_path)
40-
os.unlink(temp_path)
36+
delete_if_present(sha_path)
37+
delete_if_present(temp_path)
38+
39+
40+
def delete_if_present(path):
41+
if os.path.isfile(path):
42+
print("removing " + path)
43+
os.unlink(path)
4144

4245

4346
def download(path, url, verbose):

0 commit comments

Comments
 (0)