summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2006-02-07 13:44:48 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2006-02-07 13:44:48 (GMT)
commitf0a95eca45b6a56c0eac0ed0fee643c0a8ce9f24 (patch)
tree9a611d870c87a3dbb5c3d06df7f52893453529d2 /Lib/test
parent05110aaef59d0a0fde24bd5f12d792bf1b42b60f (diff)
downloadcpython-f0a95eca45b6a56c0eac0ed0fee643c0a8ce9f24.zip
cpython-f0a95eca45b6a56c0eac0ed0fee643c0a8ce9f24.tar.gz
cpython-f0a95eca45b6a56c0eac0ed0fee643c0a8ce9f24.tar.bz2
Saved and restored logging._handlerList at the same time as saving/restoring logging._handlers.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index bcebc83..f398720 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -467,6 +467,7 @@ def test4():
sys.stdout.write('config%d: ' % i)
loggerDict = logging.getLogger().manager.loggerDict
saved_handlers = logging._handlers.copy()
+ saved_handler_list = logging._handlerList[:]
saved_loggers = loggerDict.copy()
try:
fn = tempfile.mktemp(".ini")
@@ -484,6 +485,7 @@ def test4():
finally:
logging._handlers.clear()
logging._handlers.update(saved_handlers)
+ logging._handlerList = saved_handler_list
loggerDict = logging.getLogger().manager.loggerDict
loggerDict.clear()
loggerDict.update(saved_loggers)
@@ -526,6 +528,7 @@ class FriendlyFormatter (logging.Formatter):
def test5():
loggerDict = logging.getLogger().manager.loggerDict
saved_handlers = logging._handlers.copy()
+ saved_handler_list = logging._handlerList[:]
saved_loggers = loggerDict.copy()
try:
fn = tempfile.mktemp(".ini")
@@ -541,6 +544,7 @@ def test5():
finally:
logging._handlers.clear()
logging._handlers.update(saved_handlers)
+ logging._handlerList = saved_handler_list
loggerDict = logging.getLogger().manager.loggerDict
loggerDict.clear()
loggerDict.update(saved_loggers)