Commit b96efa4f authored by kbu's avatar kbu

save the use and manipulation of the tries variable by using a for loop

parent 9a8cb0aa
...@@ -57,13 +57,11 @@ def rmtree (path): ...@@ -57,13 +57,11 @@ def rmtree (path):
""" """
def retry_writeable (func, path, exc): def retry_writeable (func, path, exc):
os.chmod (path, 384) # 0600 os.chmod (path, 384) # 0600
tries = 10 for i in range(10):
while tries:
try: try:
func (path) func (path)
break break
except OSError: except OSError:
tries -= 1
time.sleep(0.1) time.sleep(0.1)
else: else:
# tried 10 times without success, thus # tried 10 times without success, thus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment