Skip to content

Commit 97aa0c6

Browse files
committed
Fix python2 compatibility for metadata creation
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 2dc351e commit 97aa0c6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/saml2/metadata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,11 @@ def do_pdp_descriptor(conf, cert=None, enc_cert=None):
669669

670670
def _add_attr_to_entity_attributes(extensions, attribute):
671671
try:
672-
entity_attributes = next(filter(
673-
lambda el: el.tag == mdattr.EntityAttributes.c_tag,
674-
extensions.extension_elements
675-
))
672+
entity_attributes = next(
673+
el
674+
for el in extensions.extension_elements
675+
if el.tag == mdattr.EntityAttributes.c_tag
676+
)
676677
except StopIteration:
677678
entity_attributes = mdattr.EntityAttributes(attribute=attribute)
678679
extensions.add_extension_element(entity_attributes)

0 commit comments

Comments
 (0)