mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897)
(cherry picked from commit 2353d77fad
)
Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
Automerge-Triggered-By: @vsajip
This commit is contained in:
parent
28bf82661a
commit
2c050e52f1
3 changed files with 27 additions and 1 deletions
|
@ -1324,7 +1324,11 @@ class MemoryHandler(BufferingHandler):
|
|||
"""
|
||||
Set the target handler for this handler.
|
||||
"""
|
||||
self.target = target
|
||||
self.acquire()
|
||||
try:
|
||||
self.target = target
|
||||
finally:
|
||||
self.release()
|
||||
|
||||
def flush(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue