Nick Coghlan  committed 597c306

More fine-grained monitoring of alterations to logging state

  • Participants
  • Parent commits 59f972b

Comments (0)

Files changed (1)

File Lib/test/

     resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
                  'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
-                 'warnings.filters', 'asyncore.socket_map', 'logging._handlers')
+                 'warnings.filters', 'asyncore.socket_map',
+                 'logging._handlers', 'logging._handlerList')
     def get_sys_argv(self):
         return id(sys.argv), sys.argv, sys.argv[:]
     def get_logging__handlers(self):
         # _handlers is a WeakValueDictionary
+        return id(logging._handlers), logging._handlers, logging._handlers.copy()
+    def restore_logging__handlers(self, saved_handlers):
+        # Can't easily revert the logging state
+        pass
+    def get_logging__handlerList(self):
         # _handlerList is a list of weakrefs to handlers
-        return (id(logging._handlers), logging._handlers, logging._handlers.copy(),
-                id(logging._handlerList), logging._handlerList, logging._handlerList[:])
-    def restore_logging__handlers(self, saved_handlers):
+        return id(logging._handlerList), logging._handlerList, logging._handlerList[:]
+    def restore_logging__handlerList(self, saved_handlerList):
         # Can't easily revert the logging state