Instead of checking for list type, check for collections.Iterable type.
authordeyk <deyk@crossway.org>
Wed, 18 Apr 2012 17:59:18 +0000 (10:59 -0700)
committerdeyk <deyk@crossway.org>
Wed, 18 Apr 2012 17:59:18 +0000 (10:59 -0700)
cas_provider/attribute_formatters.py

index a04828d..d61af0f 100644 (file)
@@ -1,4 +1,5 @@
 from lxml import etree
+import collections
 
 CAS_URI = 'http://www.yale.edu/tp/cas'
 NSMAP = {'cas': CAS_URI}
@@ -10,7 +11,7 @@ def jasig(auth_success, attrs):
     style = etree.SubElement(attributes, CAS + 'attraStyle')
     style.text = u'Jasig'
     for name, value in attrs.items():
-        if isinstance(value, list):
+        if isinstance(value, collections.Iterable):
             for e in value:
                 element = etree.SubElement(attributes, CAS + name)
                 element.text = e