From 59b906fd2d60bd4a8712c23796a3ccfecbf5c5ad Mon Sep 17 00:00:00 2001 From: deyk Date: Wed, 18 Apr 2012 10:59:18 -0700 Subject: [PATCH] Instead of checking for list type, check for collections.Iterable type. --- cas_provider/attribute_formatters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cas_provider/attribute_formatters.py b/cas_provider/attribute_formatters.py index a04828d..d61af0f 100644 --- a/cas_provider/attribute_formatters.py +++ b/cas_provider/attribute_formatters.py @@ -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 -- 2.20.1