diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index c1aec9880d7..ea14541e1e5 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1254,7 +1254,7 @@ class BufferingHandler(logging.Handler): """ self.acquire() try: - self.buffer = [] + self.buffer.clear() finally: self.release() @@ -1321,7 +1321,7 @@ class MemoryHandler(BufferingHandler): if self.target: for record in self.buffer: self.target.handle(record) - self.buffer = [] + self.buffer.clear() finally: self.release()