Skip to content

Commit

Permalink
gh-106238: Handle KeyboardInterrupt during logging._acquireLock() (GH…
Browse files Browse the repository at this point in the history
…-106239)

Co-authored-by: Ariel Eizenberg <ariel.eizenberg@pagaya.com>
  • Loading branch information
arieleiz and arieleizenberg authored Jul 6, 2023
1 parent 38aa89a commit 99b00ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lib/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix rare concurrency bug in lock acquisition by the logging package.

0 comments on commit 99b00ef

Please sign in to comment.