[Zconfig]
SVN: ZConfig/trunk/ZConfig/components/logger/loghandler.py
clean up internal references when a file handler is closed
explicitly
Fred L. Drake, Jr.
fdrake at gmail.com
Wed Jun 20 15:15:42 EDT 2007
Log message for revision 76856:
clean up internal references when a file handler is closed explicitly
Changed:
U ZConfig/trunk/ZConfig/components/logger/loghandler.py
-=-
Modified: ZConfig/trunk/ZConfig/components/logger/loghandler.py
===================================================================
--- ZConfig/trunk/ZConfig/components/logger/loghandler.py 2007-06-20 19:12:32 UTC (rev 76855)
+++ ZConfig/trunk/ZConfig/components/logger/loghandler.py 2007-06-20 19:15:39 UTC (rev 76856)
@@ -38,7 +38,10 @@
h.reopen()
def _remove_from_reopenable(wr):
- _reopenable_handlers.remove(wr)
+ try:
+ _reopenable_handlers.remove(wr)
+ except ValueError:
+ pass
class FileHandler(StreamHandler):
@@ -66,6 +69,7 @@
StreamHandler.close(self)
except KeyError:
pass
+ _remove_from_reopenable(self._wr)
def reopen(self):
self.close()
More information about the ZConfig
mailing list