locking (win32): deal with os.listdir PermissionErrors

due to unclear circumstances, windows sometimes just says "PermissionError" when trying to list a directory.
This commit is contained in:
Thomas Waldmann 2023-01-13 20:48:50 +01:00
parent 0ce2b55031
commit 7063c2abec
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -191,6 +191,8 @@ class ExclusiveLock:
names = os.listdir(self.path)
except FileNotFoundError: # another process did our job in the meantime.
pass
except PermissionError: # win32 might throw this.
return False
else:
for name in names:
try: