diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index ee34f8c1baa..d96d703e1d4 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -555,6 +555,8 @@ def test5(): except KeyError: logging.exception("just testing") os.remove(fn) + hdlr = logging.getLogger().handlers[0] + logging.getLogger().handlers.remove(hdlr) finally: logging._acquireLock() try: