Skip to content

Commit

Permalink
Delete populated directories during diretory cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kcartier-wri committed Sep 10, 2024
1 parent 0271e19 commit 949e097
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/tools/general_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil
import tempfile
import numpy as np

Expand All @@ -19,6 +20,8 @@ def remove_all_files_in_directory(directory):
# Check if it is a file and remove it
if os.path.isfile(file_path):
os.remove(file_path)
else:
shutil.rmtree(file_path)
except Exception as e:
print(f"Error: {e}")

Expand Down

0 comments on commit 949e097

Please sign in to comment.