- etree.SubElement(auth_success, CAS + 'attribute', name=u'attraStyle', value=u'Name-Value')
- for name, value in attrs.items():
- if isinstance(value, list):
+ etree.SubElement(auth_success, CAS + 'attribute', name='attraStyle', value='Name-Value')
+ for name, value in sorted(attrs.items()):
+ if isinstance(value, collections.abc.Iterable) and not isinstance(value, basestring):