From c4b0e20bc5dfc1ed020b30727e7ff79bbb1ce944 Mon Sep 17 00:00:00 2001 From: askeing Date: Fri, 29 Apr 2016 23:18:28 +0900 Subject: Remove dir by shutil.rmtree, remove file by os.remove --- python/servo/bootstrap_commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/servo/bootstrap_commands.py') 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: -- cgit v1.2.3