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)