Skip to content

Commit b61170e

Browse files
committed
Get DOM tests passing with DOM Level 2 implementations
1 parent ed014f6 commit b61170e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

html5lib/treewalkers/dom.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def getNodeDetails(self, node):
1818
attrs = {}
1919
for attr in node.attributes.keys():
2020
attr = node.getAttributeNode(attr)
21-
attrs[(attr.namespaceURI,attr.localName)] = attr.value
21+
if attr.namespaceURI:
22+
attrs[(attr.namespaceURI,attr.localName)] = attr.value
23+
else:
24+
attrs[(None,attr.name)] = attr.value
2225
return (_base.ELEMENT, node.namespaceURI, node.nodeName,
2326
attrs, node.hasChildNodes())
2427

0 commit comments

Comments
 (0)