Fix: allow removal of addons that are symlinked
authorJacques Lucke <mail@jlucke.com>
Mon, 28 Jan 2019 09:52:54 +0000 (10:52 +0100)
committerJacques Lucke <mail@jlucke.com>
Mon, 28 Jan 2019 09:52:54 +0000 (10:52 +0100)
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D4256

release/scripts/startup/bl_operators/wm.py

index 2cdcca562c7b6c89ce5f9442641ae56ab5c4451c..ee669d172371a5c202557309a1281cc5e9d6d0e3 100644 (file)
@@ -2171,7 +2171,10 @@ class WM_OT_addon_remove(Operator):
 
         import shutil
         if isdir:
-            shutil.rmtree(path)
+            if os.path.islink(path):
+                os.remove(path)
+            else:
+                shutil.rmtree(path)
         else:
             os.remove(path)