diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index aa9b79d8cab4bb..7cb79d5299fb40 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -2255,6 +2255,10 @@ def shutdown(handlerList=_handlerList): raise #else, swallow + # Don't attempt to cleanup handlers again if logging.shutdown is called multiple times: + if handlerList is _handlerList: + _handlerList.clear() + #Let's try and shutdown automatically on application exit... import atexit atexit.register(shutdown)