locking: get out of kill_stale_lock more quickly if directory does not exist.

This commit is contained in:
Thomas Waldmann 2023-01-18 13:44:51 +01:00
parent 9ba249b482
commit c3d0c525f9
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 1 additions and 1 deletions

View File

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