From 8158bcb4f39b79e0c3df4449824ffc353e32d23e Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 6 Mar 2023 10:52:34 -0500 Subject: [PATCH] fix: Remove symlink reguardless of source path's existence --- tools/py/core/file_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/py/core/file_utils.py b/tools/py/core/file_utils.py index fdd2fe00c..99c66add2 100644 --- a/tools/py/core/file_utils.py +++ b/tools/py/core/file_utils.py @@ -148,11 +148,9 @@ def unlink(path): def rmdir_or_unlink(dir): - if not os.path.exists(dir): - return if os.path.islink(dir): os.unlink(dir) - else: + elif os.path.exists(dir): shutil.rmtree(dir)