X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/d49a76b7b6e3907820847497e3b42ac4450b8c2d..refs/heads/master:/cas_provider/attribute_formatters.py?ds=inline diff --git a/cas_provider/attribute_formatters.py b/cas_provider/attribute_formatters.py index 8574962..405f2c1 100644 --- a/cas_provider/attribute_formatters.py +++ b/cas_provider/attribute_formatters.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from lxml import etree import collections @@ -19,7 +17,7 @@ def jasig(auth_success, attrs): style = etree.SubElement(attributes, CAS + 'attraStyle') style.text = 'Jasig' for name, value in sorted(attrs.items()): - if isinstance(value, collections.Iterable) and not isinstance(value, basestring): + if isinstance(value, collections.abc.Iterable) and not isinstance(value, basestring): for e in value: element = etree.SubElement(attributes, CAS + name) element.text = e @@ -32,7 +30,7 @@ def ruby_cas(auth_success, attrs): style = etree.SubElement(auth_success, CAS + 'attraStyle') style.text = 'RubyCAS' for name, value in sorted(attrs.items()): - if isinstance(value, collections.Iterable) and not isinstance(value, basestring): + if isinstance(value, collections.abc.Iterable) and not isinstance(value, basestring): for e in value: element = etree.SubElement(auth_success, CAS + name) element.text = e @@ -44,7 +42,7 @@ def ruby_cas(auth_success, attrs): def name_value(auth_success, attrs): etree.SubElement(auth_success, CAS + 'attribute', name='attraStyle', value='Name-Value') for name, value in sorted(attrs.items()): - if isinstance(value, collections.Iterable) and not isinstance(value, basestring): + if isinstance(value, collections.abc.Iterable) and not isinstance(value, basestring): for e in value: etree.SubElement(auth_success, CAS + 'attribute', name=name, value=e) else: