Skip to content

Commit b792281

Browse files
committed
Adds support for symlinked libraries/repos #526
1 parent 63c9daa commit b792281

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mbed/mbed.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,13 @@ def pquery(command, stdin=None, **kwargs):
213213
return stdout
214214

215215
def rmtree_readonly(directory):
216-
def remove_readonly(func, path, _):
217-
os.chmod(path, stat.S_IWRITE)
218-
func(path)
219-
220-
shutil.rmtree(directory, onerror=remove_readonly)
216+
if os.path.islink(directory):
217+
os.remove(directory)
218+
else:
219+
def remove_readonly(func, path, _):
220+
os.chmod(path, stat.S_IWRITE)
221+
func(path)
222+
shutil.rmtree(directory, onerror=remove_readonly)
221223

222224

223225
# Directory navigation

0 commit comments

Comments
 (0)