Skip to content

Commit 3484fd2

Browse files
Update redis/asyncio/lock.py
Co-authored-by: Juliano Amadeu <[email protected]>
1 parent 5aaf9db commit 3484fd2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

redis/asyncio/lock.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,10 @@ async def __aenter__(self):
175175
async def __aexit__(self, exc_type, exc_value, traceback):
176176
try:
177177
await self.release()
178-
except LockNotOwnedError:
179-
if self.raise_on_release_error:
180-
raise
181-
logger.warning("Lock was no longer owned when exiting context manager.")
182178
except LockError:
183179
if self.raise_on_release_error:
184180
raise
185-
logger.warning("Lock was unlocked when exiting context manager.")
181+
logger.warning("Lock was unlocked or no longer owned when exiting context manager.")
186182

187183
async def acquire(
188184
self,

0 commit comments

Comments
 (0)