diff --git a/src/keycloak/uma_permissions.py b/src/keycloak/uma_permissions.py index 1bf2136..94779f1 100644 --- a/src/keycloak/uma_permissions.py +++ b/src/keycloak/uma_permissions.py @@ -206,13 +206,9 @@ def build_permission_param(permissions): except AttributeError: pass - try: # treat as any other iterable of permissions - result = set() - for permission in permissions: - if not isinstance(permission, (str, UMAPermission)): - raise KeycloakPermissionFormatError("misbuilt permission {}".format(permissions)) - result.add(str(permission)) - return result - except TypeError: - pass - raise KeycloakPermissionFormatError("misbuilt permission {}".format(permissions)) + result = set() + for permission in permissions: + if not isinstance(permission, (str, UMAPermission)): + raise KeycloakPermissionFormatError("misbuilt permission {}".format(permissions)) + result.add(str(permission)) + return result