Fix added for recent changes in non-threading environments.
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index b4c823d..4191b22 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -917,9 +917,12 @@
"""
Flushes the stream.
"""
- with self.lock:
+ self.acquire()
+ try:
if self.stream and hasattr(self.stream, "flush"):
self.stream.flush()
+ finally:
+ self.release()
def emit(self, record):
"""
@@ -970,13 +973,16 @@
"""
Closes the stream.
"""
- with self.lock:
+ self.acquire()
+ try:
if self.stream:
self.flush()
if hasattr(self.stream, "close"):
self.stream.close()
StreamHandler.close(self)
self.stream = None
+ finally:
+ self.release()
def _open(self):
"""