diff options
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 4 | ||||
-rw-r--r-- | Lib/logging/config.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 1ef8f44..d5681c8 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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: diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 1d5f8c4..a31e8d0 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -79,7 +79,7 @@ def fileConfig(fname, defaults=None): logging._acquireLock() try: logging._handlers.clear() - logging._handlerList = [] + del logging._handlerList[:] # Handlers add themselves to logging._handlers handlers = _install_handlers(cp, formatters) _install_loggers(cp, handlers) |