Fix error installing app-templates & legacy add-ons overwriting symlinks

Resolve error when overwriting existing Python modules would attempt
to recursively remove a symlink which raised an error.

Related to #123827, same error but for extensions.
This commit is contained in:
Campbell Barton
2024-08-04 20:58:48 +10:00
committed by Philipp Oeser
parent 6288cd3ce7
commit 2037ced2f3
+1 -1
View File
@@ -48,7 +48,7 @@ def _module_filesystem_remove(path_base, module_name):
f_base = os.path.splitext(f)[0]
if f_base == module_name:
f_full = os.path.join(path_base, f)
if os.path.isdir(f_full):
if os.path.isdir(f_full) and (not os.path.islink(f_full)):
shutil.rmtree(f_full)
else:
os.remove(f_full)