test/clean.py: minor fix

This commit is contained in:
The MMGen Project 2024-08-29 11:17:23 +00:00
commit 945f15fe8f
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 4 additions and 5 deletions

View file

@ -53,8 +53,3 @@ extra_dirs = [
]
clean(clean_cfgs, extra_dirs=extra_dirs)
for d in extra_dirs:
if os.path.exists(d) and not os.path.isdir(d):
print(f'Removing non-directory ‘{d}')
os.unlink(d)

View file

@ -177,6 +177,10 @@ def clean(cfgs, tmpdir_ids=None, extra_dirs=[]):
fmt_list(cleaned, fmt=list_fmt)
)))
for d in extra_dirs:
if (os.path.exists(d) or os.path.islink(d)) and not os.path.isdir(d):
print(f'Removing non-directory ‘{d}')
os.unlink(d)
def get_tmpfile(cfg,fn):
return os.path.join(cfg['tmpdir'],fn)