#---------------------------------------------------------------------------
_handlers = {} #repository of handlers (for flushing when shutdown called)
+_handlerList = [] # added to allow handlers to be removed in reverse of order initialized
class Handler(Filterer):
"""
_acquireLock()
try: #unlikely to raise an exception, but you never know...
_handlers[self] = 1
+ _handlerList.insert(0, self)
finally:
_releaseLock()
self.createLock()
_acquireLock()
try: #unlikely to raise an exception, but you never know...
del _handlers[self]
+ _handlerList.remove(self)
finally:
_releaseLock()
Should be called at application exit.
"""
- for h in _handlers.keys():
+ for h in _handlerList[:]: # was _handlers.keys():
#errors might occur, for example, if files are locked
#we just ignore them
try: