Skip to content

Commit 39b0774

Browse files
committed
Fix dictionary changing size during iteration
Python3 makes .keys() a view and so del's are working on the dictionary in the view. Iterate over a copy, rater than the view directly.
1 parent 5fbd7f9 commit 39b0774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/saml2/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, allow):
2121
def __call__(self, entity_descriptor):
2222
# get descriptors
2323
_all = []
24-
for desc in entity_descriptor.keys():
24+
for desc in list(entity_descriptor.keys()):
2525
if desc.endswith("_descriptor"):
2626
typ, _ = desc.rsplit("_", 1)
2727
if typ in self.allow:

0 commit comments

Comments
 (0)