async def __aexit__(self, exc_type, exc_val, exc_tb):
        """
        Whatever happened, if there is a replacement we'll store it. And even
        if that fails, the lock is lifted afterwards.
        """

        try:
            if self.register.replacement is not None:
                logger.debug('Saving register: %s', self.register.replacement)
                await self.store._replace(self.key, self.register.replacement)
        finally:
            await self.store._finish(self.key)
async def __aexit__ ( self , exc_type , exc_val , exc_tb ) : try : if self . register . replacement is not None : logger . debug ( 'Saving register: %s' , self . register . replacement ) await self . store . _replace ( self . key , self . register . replacement ) finally : await self . store . _finish ( self . key )
Whatever happened, if there is a replacement we'll store it. And even
        if that fails, the lock is lifted afterwards.