We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c18094a commit 84c1206Copy full SHA for 84c1206
html5lib/treewalkers/etree.py
@@ -1,5 +1,12 @@
1
from __future__ import absolute_import, division, unicode_literals
2
3
+try:
4
+ from collections import OrderedDict
5
+except ImportError:
6
+ try:
7
+ from ordereddict import OrderedDict
8
+ except ImportError:
9
+ OrderedDict = dict
10
import gettext
11
_ = gettext.gettext
12
@@ -61,7 +68,7 @@ def getNodeDetails(self, node):
61
68
else:
62
69
namespace = None
63
70
tag = node.tag
64
- attrs = {}
71
+ attrs = OrderedDict()
65
72
for name, value in list(node.attrib.items()):
66
73
match = tag_regexp.match(name)
67
74
if match:
0 commit comments