mirror of
https://github.com/servo/servo.git
synced 2025-06-19 22:59:03 +01:00
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:
commit
491b5ff47e
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue