diff options
author | eseidel <eseidel@chromium.org> | 2015-07-01 12:09:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-01 19:10:18 +0000 |
commit | add100b7cd19ae6caad54ac6c6ed9766b7f1f70b (patch) | |
tree | b11c4f42d7dec2d92d5f0dfd2f17aad22668669e /build/symlink.py | |
parent | 7dd15705ef9a86b1443cc0a3019a9007f14ee428 (diff) | |
download | chromium_src-add100b7cd19ae6caad54ac6c6ed9766b7f1f70b.zip chromium_src-add100b7cd19ae6caad54ac6c6ed9766b7f1f70b.tar.gz chromium_src-add100b7cd19ae6caad54ac6c6ed9766b7f1f70b.tar.bz2 |
Teach build/symlink.py --force to delete directories.
Otherwise os.remove just fails saying it can't delete a directory.
R=dpranke@chromium.org
Review URL: https://codereview.chromium.org/1222573002
Cr-Commit-Position: refs/heads/master@{#337083}
Diffstat (limited to 'build/symlink.py')
-rwxr-xr-x | build/symlink.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/build/symlink.py b/build/symlink.py index aade2f8..b88f1b6 100755 --- a/build/symlink.py +++ b/build/symlink.py @@ -9,6 +9,7 @@ import errno import optparse import os.path +import shutil import sys @@ -29,7 +30,10 @@ def Main(argv): os.symlink(s, t) except OSError, e: if e.errno == errno.EEXIST and options.force: - os.remove(t) + if os.path.isdir(t): + shutil.rmtree(t, ignore_errors=True) + else: + os.remove(t) os.symlink(s, t) else: raise |