aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap_commands.py
diff options
context:
space:
mode:
authoraskeing <askeing@gmail.com>2016-04-29 23:18:28 +0900
committeraskeing <askeing@gmail.com>2016-04-29 23:18:28 +0900
commitc4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944 (patch)
tree32b522b6f3526178862a9b723aebf501c68eaa2e /python/servo/bootstrap_commands.py
parent26be403e3c8351af638cce3a2a1ed4d3be8022df (diff)
downloadservo-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.py5
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: