[CalendarServer-changes] [12414] twext/trunk/twext/python/log.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:22:30 PDT 2014


Revision: 12414
          http://trac.calendarserver.org//changeset/12414
Author:   wsanchez at apple.com
Date:     2014-01-21 10:56:53 -0800 (Tue, 21 Jan 2014)
Log Message:
-----------
Catch AttributeError and don't patch modules that lack __name__.
Fixes #832.

Modified Paths:
--------------
    twext/trunk/twext/python/log.py

Modified: twext/trunk/twext/python/log.py
===================================================================
--- twext/trunk/twext/python/log.py	2014-01-21 00:27:07 UTC (rev 12413)
+++ twext/trunk/twext/python/log.py	2014-01-21 18:56:53 UTC (rev 12414)
@@ -939,7 +939,13 @@
             continue
 
         for name, obj in module.__dict__.iteritems():
-            newLogger = Logger(namespace=module.__name__)
+            try:
+                newLogger = Logger(namespace=module.__name__)
+            except AttributeError:
+                # Can't look up __name__.  A hack in the "six" module causes
+                # this.  Skip the module.
+                # See https://trac.calendarserver.org/ticket/832
+                continue
             legacyLogger = LegacyLogger(logger=newLogger)
 
             if obj is twisted.python.log:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/e8857436/attachment.html>


More information about the calendarserver-changes mailing list