[docs]classTimeout(TimeoutError):# noqa: N818"""Raised when the lock could not be acquired in *timeout* seconds."""def__init__(self,lock_file:str)->None:super().__init__()self._lock_file=lock_filedef__reduce__(self)->str|tuple[Any,...]:returnself.__class__,(self._lock_file,)# Properly pickle the exceptiondef__str__(self)->str:returnf"The file lock '{self._lock_file}' could not be acquired."def__repr__(self)->str:returnf"{self.__class__.__name__}({self.lock_file!r})"@propertydeflock_file(self)->str:""":return: The path of the file lock."""returnself._lock_file