better error handling when cleaning old runs
This commit is contained in:
parent
3846e8f303
commit
572f43010e
@ -159,7 +159,10 @@ def print_runs(runs, clean=True):
|
||||
print("\n\n")
|
||||
if clean:
|
||||
for run in runs:
|
||||
shutil.rmtree(run)
|
||||
try:
|
||||
shutil.rmtree(run)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
def main():
|
||||
time_format = '%Y-%m-%d_%H%M'
|
||||
@ -215,7 +218,10 @@ def main():
|
||||
if previous_runs:
|
||||
print("Success after {} failed runs\n".format(len(previous_runs)))
|
||||
print_runs(previous_runs.keys())
|
||||
shutil.rmtree(libdir)
|
||||
try:
|
||||
shutil.rmtree(libdir)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
return 0
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user