Index: tools/clean_output_directory.py |
diff --git a/tools/clean_output_directory.py b/tools/clean_output_directory.py |
index f94259bb610e0dab8ce21b89494745ac3f2f6cf0..e41671c4d336c24f933407f7bb060983ac22a22a 100755 |
--- a/tools/clean_output_directory.py |
+++ b/tools/clean_output_directory.py |
@@ -12,7 +12,13 @@ import utils |
def Main(): |
build_root = utils.GetBuildRoot(utils.GuessOS()) |
print 'Deleting %s' % build_root |
- shutil.rmtree(build_root, ignore_errors=True) |
+ if sys.platform != 'win32': |
+ shutil.rmtree(build_root, ignore_errors=True) |
+ else: |
+ # Intentionally ignore return value since a directory might be in use. |
+ subprocess.call(['rmdir', '/Q', '/S', build_root], |
+ env=os.environ.copy(), |
+ shell=True) |
return 0 |
if __name__ == '__main__': |