Skip to content

Commit

Permalink
fix: delete temporary folders locally only if they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
phueb committed Mar 21, 2021
1 parent f05b4b6 commit 85ffb2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ludwig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


__version__ = '4.0.1'
__version__ = '4.0.2'


def print_ludwig(s):
Expand Down
5 changes: 3 additions & 2 deletions ludwig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 85ffb2d

Please sign in to comment.