[CalendarServer-changes] [10737] CalendarServer/trunk/twext/who/util.py
source_changes at macosforge.org
source_changes at macosforge.org
Fri Feb 15 12:42:46 PST 2013
Revision: 10737
http://trac.calendarserver.org//changeset/10737
Author: wsanchez at apple.com
Date: 2013-02-15 12:42:46 -0800 (Fri, 15 Feb 2013)
Log Message:
-----------
Use flags.__iter__ if it's available.
Modified Paths:
--------------
CalendarServer/trunk/twext/who/util.py
Modified: CalendarServer/trunk/twext/who/util.py
===================================================================
--- CalendarServer/trunk/twext/who/util.py 2013-02-15 20:42:06 UTC (rev 10736)
+++ CalendarServer/trunk/twext/who/util.py 2013-02-15 20:42:46 UTC (rev 10737)
@@ -99,6 +99,9 @@
def iterFlags(flags):
- # Work around http://twistedmatrix.com/trac/ticket/6302
- # FIXME: This depends on a private attribute (flags._container)
- return (flags._container.lookupByName(name) for name in flags.names)
+ if hasattr(flags, "__iter__"):
+ return flags
+ else:
+ # Work around http://twistedmatrix.com/trac/ticket/6302
+ # FIXME: This depends on a private attribute (flags._container)
+ return (flags._container.lookupByName(name) for name in flags.names)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130215/30aae455/attachment.html>
More information about the calendarserver-changes
mailing list