]> granicus.if.org Git - python/commitdiff
logging's atexit hook now runs even if the rest of the module has
authorGeorg Brandl <georg@python.org>
Fri, 11 Aug 2006 07:26:10 +0000 (07:26 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 11 Aug 2006 07:26:10 +0000 (07:26 +0000)
already been cleaned up.

Lib/logging/__init__.py
Misc/NEWS

index e8852f3668e8b0b7ecbf74260aa3ee51238db13d..dc3400d00dd9eeb95af9fb3336a0fab73528b3b3 100644 (file)
@@ -1337,14 +1337,14 @@ def disable(level):
     """
     root.manager.disable = level
 
-def shutdown():
+def shutdown(handlerList=_handlerList):
     """
     Perform any cleanup actions in the logging system (e.g. flushing
     buffers).
 
     Should be called at application exit.
     """
-    for h in _handlerList[:]: # was _handlers.keys():
+    for h in handlerList[:]:
         #errors might occur, for example, if files are locked
         #we just ignore them if raiseExceptions is not set
         try:
index f2fc704688a270592cb72d34cbe882444238893b..26047f6ce95e5af15343afce03af9c3ad4f85b2d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -38,6 +38,9 @@ Core and builtins
 Library
 -------
 
+- logging's atexit hook now runs even if the rest of the module has
+  already been cleaned up.
+
 - Bug #1112549, DoS attack on cgi.FieldStorage.
 
 - Bug #1531405, format_exception no longer raises an exception if