From 8c903944e8001ef41ecc817cb07f06e5dd3b22cf Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 7 May 2026 14:11:06 +0200 Subject: [PATCH] Use isinstance instead of type is for config In Django you can use special settings drivers that may represent dicts as a subclass of pythons 'dict'. In this case leading to crash while parsing the metadata section of the config. --- src/saml2/mdstore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py index 2ea9742f0..9dd0019c6 100644 --- a/src/saml2/mdstore.py +++ b/src/saml2/mdstore.py @@ -1114,7 +1114,7 @@ def reload(self, spec): def imp(self, spec): # This serves as a backwards compatibility - if type(spec) is dict: + if isinstance(spec, dict): # Old style... for key, vals in spec.items(): for val in vals: