diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2019-05-14 15:01:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 15:01:35 +0200 |
commit | d655fc924af5ddd56a51d1e6bb41e6bf3d3d1843 (patch) | |
tree | 10ff0de30e1d253be29ce8438b5d69fe610fde16 /src | |
parent | 1d06338385c2c59964560fd7ec0fc51d5339650b (diff) | |
parent | 15bdc66ac776e04777666fff3d08a38e24f5305a (diff) | |
download | pysaml2-d655fc924af5ddd56a51d1e6bb41e6bf3d3d1843.tar.gz |
Merge pull request #613 from skoranda/more_flexible_entity_category_import
Make entity category imports more flexible
Diffstat (limited to 'src')
-rw-r--r-- | src/saml2/assertion.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/saml2/assertion.py b/src/saml2/assertion.py index 8984db59..ed043d9a 100644 --- a/src/saml2/assertion.py +++ b/src/saml2/assertion.py @@ -353,8 +353,11 @@ class Policy(object): else: ecs = [] for cat in items: - _mod = importlib.import_module( - "saml2.entity_category.%s" % cat) + try: + _mod = importlib.import_module(cat) + except ImportError: + _mod = importlib.import_module( + "saml2.entity_category.%s" % cat) _ec = {} for key, items in _mod.RELEASE.items(): alist = [k.lower() for k in items] |