Browse Source

use for loop

Thomas Waldmann 2 years ago
parent
commit
9ba249b482
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/borg/locking.py

+ 1 - 3
src/borg/locking.py

@@ -170,9 +170,7 @@ class ExclusiveLock:
         if not self.by_me():
             raise NotMyLock(self.path)
         os.unlink(self.unique_name)
-        retry = 0
-        while retry < 42:
-            retry += 1
+        for retry in range(42):
             try:
                 os.rmdir(self.path)
             except OSError as err: