Skip to content

Commit 2a6b392

Browse files
[#287] Bug in LocalOperations::rmdirs is fixed (#288)
1 parent 1200524 commit 2a6b392

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testgres/operations/local_ops.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,24 +333,24 @@ def rmdirs(self, path, ignore_errors=True, attempts=3, delay=1):
333333
assert attempts > 0
334334
assert delay >= 0
335335

336-
attempt = 0
336+
a = 0
337337
while True:
338-
assert attempt < attempts
339-
attempt += 1
338+
assert a < attempts
339+
a += 1
340340
try:
341341
rmtree(path)
342342
except FileNotFoundError:
343343
pass
344344
except Exception as e:
345-
if attempt < attempt:
345+
if a < attempts:
346346
errMsg = "Failed to remove directory {0} on attempt {1} ({2}): {3}".format(
347-
path, attempt, type(e).__name__, e
347+
path, a, type(e).__name__, e
348348
)
349349
logging.warning(errMsg)
350350
time.sleep(delay)
351351
continue
352352

353-
assert attempt == attempts
353+
assert a == attempts
354354
if not ignore_errors:
355355
raise
356356

0 commit comments

Comments
 (0)