def __enter__(self):
        """
        Start the lock with timeout if needed in the acquire operation

        Raises:
            TimerException: if the timeout is reached before acquiring the lock
        """
        try:
            with ExceptionTimer(timeout=self.timeout):
                LOGGER.debug('Acquiring lock for {}'.format(self.path))
                self.lock.acquire()
                LOGGER.debug('Holding the lock for {}'.format(self.path))
        except TimerException:
            raise TimerException(
                'Unable to acquire lock for %s in %s secs',
                self.path,
                self.timeout,
            )
def __enter__ ( self ) : try : with ExceptionTimer ( timeout = self . timeout ) : LOGGER . debug ( 'Acquiring lock for {}' . format ( self . path ) ) self . lock . acquire ( ) LOGGER . debug ( 'Holding the lock for {}' . format ( self . path ) ) except TimerException : raise TimerException ( 'Unable to acquire lock for %s in %s secs' , self . path , self . timeout , )
Start the lock with timeout if needed in the acquire operation

        Raises:
            TimerException: if the timeout is reached before acquiring the lock