Chromium Code Reviews| Index: build/symlink.py |
| diff --git a/build/symlink.py b/build/symlink.py |
| index aade2f865c7a18993dcf58d5aa68ea74464741fa..b88f1b65dc1ab7c2fd656155b2f0812f3fb46b19 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) |
|
Nico
2015/07/01 18:26:43
Do you need this to work on Windows? shutil.rmtree
|
| + else: |
| + os.remove(t) |
| os.symlink(s, t) |
| else: |
| raise |