Skip to content

Commit

Permalink
return early in repeat_rmtree if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
itziakos committed Aug 17, 2024
1 parent bd4738f commit 8e6cf6a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions zipfile2/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ def skip_unless_symlink(test):


def repeat_rmtree(*args, **kwargs):
# Windows rmtree might fail the first time
for _ in range(5):
try:
shutil.rmtree(*args, **kwargs)
except Exception:
pass
# Windows rmtree might fail the first time
for _ in range(5):
try:
shutil.rmtree(*args, **kwargs)
except Exception:
pass
else:
break

0 comments on commit 8e6cf6a

Please sign in to comment.