fix: Remove symlink reguardless of source path's existence
This commit is contained in:
1 parent
b03cb94d60
commit
8158bcb4f3
1 file changed
+1
-3
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user