diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ee/part/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py index e0b0087..cf60dd5 100644 --- a/src/ee/part/__init__.py +++ b/src/ee/part/__init__.py @@ -83,6 +83,10 @@ def save_db(dir_path: Path, db: PartDb): if not idx_path.is_file(): raise EeException("The given db directory exists, but does not look like a part db dir") + for p in dir_path.iterdir(): + if not p.is_file(): + raise EeException("Non-file: {}".format(p)) + p.unlink() dir_path.rmdir() dir_path.mkdir(parents=True, exist_ok=True) |