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}
This commit is contained in:
Henrik Kjellander 2015-04-29 11:27:22 +02:00
parent 1ba344a070
commit c444de6276

View File

@ -348,7 +348,8 @@ class WebRTCLinkSetup():
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]