]> granicus.if.org Git - python/commitdiff
logging: made _handlers a WeakValueDictionary.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Wed, 25 Nov 2009 09:22:47 +0000 (09:22 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Wed, 25 Nov 2009 09:22:47 +0000 (09:22 +0000)
Lib/logging/__init__.py

index f5dfc39b644b6abf94e7bc9eb3f3cf07c6a8b5af..b1f92b02e4892d0c37440597c095048c07a2c72f 100644 (file)
@@ -590,7 +590,7 @@ class Filterer(object):
 #   Handler classes and functions
 #---------------------------------------------------------------------------
 
-_handlers = {}  #map of handler names to handlers
+_handlers = weakref.WeakValueDictionary()  #map of handler names to handlers
 _handlerList = [] # added to allow handlers to be removed in reverse of order initialized
 
 def _removeHandlerRef(wr):