From cb7b26e25eb831fce89feabfb5c0d5803fdffa1c Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Fri, 26 Apr 2019 13:20:37 +0200 Subject: [PATCH] Remove now-deprecated params + more defensive --- scripts/grt/export.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/grt/export.py b/scripts/grt/export.py index a3eab5d71ce..0a8c3f9e2b2 100644 --- a/scripts/grt/export.py +++ b/scripts/grt/export.py @@ -292,11 +292,15 @@ def main(argv): # Now on to outputs. with tarfile.open(REPORT_BASE + '.tar.gz', 'w:gz') as handle: - for name in ('jobs', 'metric_num', 'params', 'datasets'): - handle.add(REPORT_BASE + '.' + name + '.tsv') + for name in ('jobs', 'metric_num', 'datasets'): + path = REPORT_BASE + '.' + name + '.tsv' + if os.path.exists(path): + handle.add(path) - for name in ('jobs', 'metric_num', 'params', 'datasets'): - os.unlink(REPORT_BASE + '.' + name + '.tsv') + for name in ('jobs', 'metric_num', 'datasets'): + path = REPORT_BASE + '.' + name + '.tsv' + if os.path.exists(path): + os.unlink(REPORT_BASE + '.' + name + '.tsv') _times.append(('job_finish', time.time() - _start_time)) sha = hash_util.memory_bound_hexdigest(hash_util.sha256, REPORT_BASE + ".tar.gz")