From 945f15fe8fdba8be6d12b3f4055e1f024caa0c8c Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 29 Aug 2024 11:17:23 +0000 Subject: [PATCH] test/clean.py: minor fix --- test/clean.py | 5 ----- test/include/common.py | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/clean.py b/test/clean.py index a10575a5..3d2e66aa 100755 --- a/test/clean.py +++ b/test/clean.py @@ -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) diff --git a/test/include/common.py b/test/include/common.py index 5fdd403e..7a9dc23c 100755 --- a/test/include/common.py +++ b/test/include/common.py @@ -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)