Compatibility fix for Python 2.6

(NamedNodeList seems not to have had the iterkeys method back then)
This commit is contained in:
Eduard Braun 2015-11-21 23:29:59 +01:00
parent 46a2ada361
commit 6254548582

View file

@ -2913,8 +2913,8 @@ def scourString(in_string, options=None):
return False return False
else: else:
for element in doc.getElementsByTagName("*"): for element in doc.getElementsByTagName("*"):
for attrName in six.iterkeys(element.attributes): for attribute in element.attributes.values():
if attrName.startswith(prefix): if attribute.name.startswith(prefix):
return False return False
return True return True