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 -->
This commit is contained in:
bors-servo 2016-04-30 03:42:18 -07:00
commit 491b5ff47e

View file

@ -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: