1 Commits

Author SHA1 Message Date
572f43010e better error handling when cleaning old runs 2020-12-17 13:04:44 +01:00
2 changed files with 9 additions and 3 deletions

View File

@ -159,7 +159,10 @@ def print_runs(runs, clean=True):
print("\n\n")
if clean:
for run in runs:
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())
try:
shutil.rmtree(libdir)
except FileNotFoundError:
pass
return 0

View File

@ -5,7 +5,7 @@ with open('README.md', 'r') as fh:
setuptools.setup(
name='cronwrapper',
version='0.1.2',
version='0.1.3',
author='Fredrik Eriksson',
author_email='feffe@fulh.ax',
description='A small wrapper to handle cronjob failures',