[CalendarServer-changes] [11716] CalendarServer/branches/users/glyph/log-cleanups/twext/python/log. py

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 17 16:02:27 PDT 2013


Revision: 11716
          http://trac.calendarserver.org//changeset/11716
Author:   glyph at apple.com
Date:     2013-09-17 16:02:27 -0700 (Tue, 17 Sep 2013)
Log Message:
-----------
rather than 'del', don't leak loop variable into global scope at all

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/log-cleanups/twext/python/log.py

Modified: CalendarServer/branches/users/glyph/log-cleanups/twext/python/log.py
===================================================================
--- CalendarServer/branches/users/glyph/log-cleanups/twext/python/log.py	2013-09-17 23:02:26 UTC (rev 11715)
+++ CalendarServer/branches/users/glyph/log-cleanups/twext/python/log.py	2013-09-17 23:02:27 UTC (rev 11716)
@@ -483,13 +483,15 @@
 
     setattr(Logger, level.name, log_emit)
 
-for level in LogLevel.iterconstants(): 
-    bindEmit(level)
 
-del level
 
+def _bindLevels():
+    for level in LogLevel.iterconstants():
+        bindEmit(level)
 
+_bindLevels()
 
+
 #
 # Observers
 #
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130917/3f4d87c5/attachment.html>


More information about the calendarserver-changes mailing list