File tree 2 files changed +4
-5
lines changed 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def __init__(
130
130
token is *not* stored in thread local storage, then
131
131
thread-1 would see the token value as "xyz" and would be
132
132
able to successfully release the thread-2's lock.
133
-
133
+
134
134
``raise_on_release_error`` indicates whether to raise an exception when
135
135
the lock is no longer owned when exiting the context manager. By default,
136
136
this is True, meaning an exception will be raised. If False, the warning
@@ -174,12 +174,11 @@ async def __aenter__(self):
174
174
async def __aexit__ (self , exc_type , exc_value , traceback ):
175
175
try :
176
176
await self .release ()
177
- except LockNotOwnedError as e :
177
+ except LockNotOwnedError :
178
178
if self .raise_on_release_error :
179
179
raise
180
180
logger .warning ("Lock was no longer owned when exiting context manager." )
181
181
182
-
183
182
async def acquire (
184
183
self ,
185
184
blocking : Optional [bool ] = None ,
Original file line number Diff line number Diff line change @@ -180,9 +180,9 @@ def __exit__(
180
180
) -> None :
181
181
try :
182
182
self .release ()
183
- except LockNotOwnedError as e :
183
+ except LockNotOwnedError :
184
184
if self .raise_on_release_error :
185
- raise e
185
+ raise
186
186
logger .warning ("Lock was no longer owned when exiting context manager." )
187
187
188
188
def acquire (
You can’t perform that action at this time.
0 commit comments