summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/logging/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 2f081a0a85..aaad89884f 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1627,6 +1627,7 @@ def shutdown(handlerList=_handlerList):
h = wr()
if h:
try:
+ h.acquire()
h.flush()
h.close()
except (IOError, ValueError):
@@ -1635,6 +1636,8 @@ def shutdown(handlerList=_handlerList):
# references to them are still around at
# application exit.
pass
+ finally:
+ h.release()
except:
if raiseExceptions:
raise