servo: Merge #10923 - Remove dir by shutil.rmtree, remove file by os.remove (from askeing:fix_10922); r=jdm

fix #10922

Source-Repo: https://github.com/servo/servo
Source-Revision: 491b5ff47e392f37cb636bbbdeecf5cd6254b401
This commit is contained in:
askeing 2016-04-30 03:42:18 -07:00
Родитель 9d3b92895f
Коммит 7833eac81c
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

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