gh-106238: Handle KeyboardInterrupt during logging._acquireLock() (GH… · python/cpython@99b00ef (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Commit 99b00ef
and
authored
gh-106238: Handle KeyboardInterrupt during logging._acquireLock() (GH-106239)
Co-authored-by: Ariel Eizenberg ariel.eizenberg@pagaya.com
File tree
2 files changed
lines changed
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -238,7 +238,11 @@ def _acquireLock(): | ||
238 | 238 | This should be released with _releaseLock(). |
239 | 239 | """ |
240 | 240 | if _lock: |
241 | -_lock.acquire() | |
241 | +try: | |
242 | +_lock.acquire() | |
243 | +except BaseException: | |
244 | +_lock.release() | |
245 | +raise | |
242 | 246 | |
243 | 247 | def _releaseLock(): |
244 | 248 | """ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 | +Fix rare concurrency bug in lock acquisition by the logging package. |