aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap_commands.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-30 03:42:18 -0700
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-30 03:42:18 -0700
commit491b5ff47e392f37cb636bbbdeecf5cd6254b401 (patch)
treefe47fe66e78660047d1b160cb9659ff3751ffcb2 /python/servo/bootstrap_commands.py
parenta98a53925f09a1b1d65c4680ca7990f9ac3ee1bc (diff)
parentc4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944 (diff)
downloadservo-491b5ff47e392f37cb636bbbdeecf5cd6254b401.tar.gz
servo-491b5ff47e392f37cb636bbbdeecf5cd6254b401.zip
Auto merge of #10923 - askeing:fix_10922, r=jdm
Remove dir by shutil.rmtree, remove file by os.remove fix #10922 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10923) <!-- Reviewable:end -->
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 044cd8c80c4..5630b778771 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -319,7 +319,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: