AddonManager: handle the case of symlinked addon when uninstalling
see #11045
This commit is contained in:
committed by
Chris Hennes
parent
6c1c25b24a
commit
dcddc3dc64
@@ -97,7 +97,10 @@ def symlink(source, link_name):
|
||||
|
||||
def rmdir(path: os.PathLike) -> bool:
|
||||
try:
|
||||
shutil.rmtree(path, onerror=remove_readonly)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path) # Remove symlink
|
||||
else:
|
||||
shutil.rmtree(path, onerror=remove_readonly)
|
||||
except (WindowsError, PermissionError, OSError):
|
||||
return False
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user