Skip to content

Commit 8df2e49

Browse files
committed
address review
1 parent bb78536 commit 8df2e49

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

misc/bazel/internal/install.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,20 @@
4747
if platform.system() == 'Windows':
4848
# On Windows we might have virus scanner still looking at the path so
4949
# attempt removal a couple of times sleeping between each attempt.
50-
for attempt in [1, 2]:
50+
for retry_delay in [1, 2, 2]:
5151
try:
5252
shutil.rmtree(destdir)
5353
break
5454
except OSError as e:
5555
if e.winerror == 32:
56-
time.sleep(attempt)
56+
time.sleep(retry_delay)
5757
else:
5858
raise
59+
else:
60+
shutil.rmtree(destdir)
5961
else:
6062
shutil.rmtree(destdir)
63+
6164
destdir.mkdir(parents=True, exist_ok=True)
6265
subprocess.run([script, "--destdir", destdir], check=True)
6366

0 commit comments

Comments
 (0)