Browse Source

test/clean.py: minor fix

The MMGen Project 6 months ago
parent
commit
945f15fe8f
2 changed files with 4 additions and 5 deletions
  1. 0 5
      test/clean.py
  2. 4 0
      test/include/common.py

+ 0 - 5
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)

+ 4 - 0
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)