diff options
author | askeing <askeing@gmail.com> | 2016-04-29 23:18:28 +0900 |
---|---|---|
committer | askeing <askeing@gmail.com> | 2016-04-29 23:18:28 +0900 |
commit | c4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944 (patch) | |
tree | 32b522b6f3526178862a9b723aebf501c68eaa2e /python/servo/bootstrap_commands.py | |
parent | 26be403e3c8351af638cce3a2a1ed4d3be8022df (diff) | |
download | servo-c4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944.tar.gz servo-c4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944.zip |
Remove dir by shutil.rmtree, remove file by os.remove
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index d49c1e431c9..c075c2449b5 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -316,7 +316,10 @@ class MachCommands(CommandBase): name = path.join(base, name) if force: print("Removing " + name) - shutil.rmtree(name) + if os.path.isdir(name): + shutil.rmtree(name) + else: + os.remove(name) else: print("Would remove " + name) if not removing_anything: |