Commit 2c2b8c43 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

incase of symlink, we should just delete it instead of calling os.chmod that...

incase of symlink, we should just delete it instead of calling os.chmod that tries to chmod the original that can raise 'Operation not permitted' error.
parent 12706228
......@@ -54,8 +54,11 @@ def rmtree (path):
0
"""
def retry_writeable (func, path, exc):
os.chmod (path, 0600)
func (path)
if func == os.path.islink:
os.unlink(path)
else:
os.chmod (path, 0600)
func (path)
shutil.rmtree (path, onerror = retry_writeable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment