Make setup_links.py handle non-link directories during cleanup
The trybots ended up in a state that could not be cleaned up
when other tryjobs were altering the checkout with different
variations of dependencies.
TBR=pbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/46139004
Cr-Commit-Position: refs/heads/master@{#9110}
diff --git a/setup_links.py b/setup_links.py
index e5e3477..ed8b923 100755
--- a/setup_links.py
+++ b/setup_links.py
@@ -348,7 +348,8 @@
if not self._dry_run:
if os.path.exists(link_path):
if sys.platform.startswith('win') and os.path.isdir(link_path):
- subprocess.check_call(['rmdir', '/q', link_path], shell=True)
+ subprocess.check_call(['rmdir', '/q', '/s', link_path],
+ shell=True)
else:
os.remove(link_path)
del self._links_db[source]