From 7df3a6f5e0b152207274617cdd037077aca46fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 25 Mar 2018 09:57:42 +0200 Subject: [PATCH] python3: don't use iteritems --- mellon/adapters.py | 4 ++-- mellon/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mellon/adapters.py b/mellon/adapters.py index 8be35d2..7b136bd 100644 --- a/mellon/adapters.py +++ b/mellon/adapters.py @@ -158,7 +158,7 @@ class DefaultAdapter(object): realm = utils.get_setting(idp, 'REALM') attribute_mapping = utils.get_setting(idp, 'ATTRIBUTE_MAPPING') attribute_set = False - for field, tpl in attribute_mapping.iteritems(): + for field, tpl in attribute_mapping.items(): try: value = unicode(tpl).format(realm=realm, attributes=saml_attributes, idp=idp) except ValueError: @@ -184,7 +184,7 @@ class DefaultAdapter(object): if not superuser_mapping: return attribute_set = False - for key, values in superuser_mapping.iteritems(): + for key, values in superuser_mapping.items(): if key in saml_attributes: if not isinstance(values, (tuple, list)): values = [values] diff --git a/mellon/utils.py b/mellon/utils.py index 6affd8a..830f711 100644 --- a/mellon/utils.py +++ b/mellon/utils.py @@ -114,7 +114,7 @@ def get_idps(): def flatten_datetime(d): d = d.copy() - for key, value in d.iteritems(): + for key, value in d.items(): if isinstance(value, datetime.datetime): d[key] = value.isoformat() return d