summaryrefslogtreecommitdiff
path: root/_clean_tables.py
diff options
context:
space:
mode:
Diffstat (limited to '_clean_tables.py')
-rw-r--r--_clean_tables.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/_clean_tables.py b/_clean_tables.py
index 155a820..5b0f1c3 100644
--- a/_clean_tables.py
+++ b/_clean_tables.py
@@ -14,7 +14,10 @@ def do_cleanup(root):
for pattern in file_patterns:
if fnmatch.fnmatch(file, pattern):
fullpath = os.path.join(path, file)
- shutil.rmtree(fullpath, ignore_errors=True)
+ if os.path.isdir(fullpath):
+ shutil.rmtree(fullpath, ignore_errors=False)
+ else:
+ os.unlink(fullpath)
print('Deleted', fullpath)
except OSError:
pass