Make sure that we are not iterating over tag.attrs.items()

pull/403/head
Karl Hobley 2014-07-01 16:11:08 +01:00
rodzic e58929d79b
commit a4bd768a7d
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -29,7 +29,7 @@ def attribute_rule(allowed_attrs):
* if the lookup returns a truthy value, keep the attribute; if falsy, drop it
"""
def fn(tag):
for attr, val in tag.attrs.items():
for attr, val in list(tag.attrs.items()):
rule = allowed_attrs.get(attr)
if rule:
if callable(rule):