mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-106238: Handle KeyboardInterrupt during logging._acquireLock() (GH-106239)
Co-authored-by: Ariel Eizenberg <ariel.eizenberg@pagaya.com>
This commit is contained in:
parent
38aa89a52e
commit
99b00efd5e
2 changed files with 6 additions and 1 deletions
|
@ -238,7 +238,11 @@ def _acquireLock():
|
|||
This should be released with _releaseLock().
|
||||
"""
|
||||
if _lock:
|
||||
_lock.acquire()
|
||||
try:
|
||||
_lock.acquire()
|
||||
except BaseException:
|
||||
_lock.release()
|
||||
raise
|
||||
|
||||
def _releaseLock():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue