mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Handle "BlockingIOError" when locking file resource
This commit is contained in:
@@ -70,7 +70,8 @@ class LockFile(object):
|
||||
fcntl.flock(self._fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
elif LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_MSVCRT:
|
||||
msvcrt.locking(self._fp.fileno(), msvcrt.LK_NBLCK, 1)
|
||||
except IOError:
|
||||
except (BlockingIOError, IOError):
|
||||
self._fp.close()
|
||||
self._fp = None
|
||||
raise LockFileExists
|
||||
return True
|
||||
|
Reference in New Issue
Block a user