From 85ffb2d1323f35c5e23c9985ca80eb9c24a937d1 Mon Sep 17 00:00:00 2001 From: phueb Date: Sun, 21 Mar 2021 13:12:41 -0500 Subject: [PATCH] fix: delete temporary folders locally only if they exist --- ludwig/__init__.py | 2 +- ludwig/__main__.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ludwig/__init__.py b/ludwig/__init__.py index c2d16f0..68f9ff1 100644 --- a/ludwig/__init__.py +++ b/ludwig/__init__.py @@ -1,6 +1,6 @@ -__version__ = '4.0.1' +__version__ = '4.0.2' def print_ludwig(s): diff --git a/ludwig/__main__.py b/ludwig/__main__.py index e7cbb1a..d6055b1 100644 --- a/ludwig/__main__.py +++ b/ludwig/__main__.py @@ -263,8 +263,9 @@ def submit(): # temporary runs folder auto-created with name = {project_name}_runs must be removed path_tmp = cwd / f'{src_path.name}_runs' - shutil.rmtree(path_tmp) - print(f'Removed temporary directory {path_tmp}') + if path_tmp.exists(): + shutil.rmtree(path_tmp) + print(f'Removed temporary directory {path_tmp}') # if running on Ludwig, save worker instructions to shared drive else: