summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/handlers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 4a120e9..867ef4e 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -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):
"""