From a10a4f871d20c9b96067dd7051c12030a4441e14 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 20 Sep 2021 11:54:11 +0200 Subject: [PATCH 07/59] misc: fix unidiomatic-typecheck pylint error (#56982) --- src/authentic2/idp/saml/saml2_endpoints.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authentic2/idp/saml/saml2_endpoints.py b/src/authentic2/idp/saml/saml2_endpoints.py index fe1cb7ce..873ee6ca 100644 --- a/src/authentic2/idp/saml/saml2_endpoints.py +++ b/src/authentic2/idp/saml/saml2_endpoints.py @@ -377,16 +377,16 @@ def saml2_add_attribute_values(assertion, attributes): # Only name/values or name/format/values name = None values = None - if type(key) is tuple and len(key) == 2: + if isinstance(key, tuple) and len(key) == 2: name, format = key attribute.nameFormat = format values = attributes[(name, format)] - elif type(key) is tuple and len(key) == 3: + elif isinstance(key, tuple) and len(key) == 3: name, format, nickname = key attribute.nameFormat = format attribute.friendlyName = nickname values = attributes[(name, format, nickname)] - elif type(key) is tuple: + elif isinstance(key, tuple): return else: name = key -- 2.30.2