Skip to content

Commit 81b97d5

Browse files
committed
Merge pull request html5lib#55 from ambv/master
Use OrderedDict for arguments in etree walker
2 parents c18094a + 84c1206 commit 81b97d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

html5lib/treewalkers/etree.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
from __future__ import absolute_import, division, unicode_literals
22

3+
try:
4+
from collections import OrderedDict
5+
except ImportError:
6+
try:
7+
from ordereddict import OrderedDict
8+
except ImportError:
9+
OrderedDict = dict
310
import gettext
411
_ = gettext.gettext
512

@@ -61,7 +68,7 @@ def getNodeDetails(self, node):
6168
else:
6269
namespace = None
6370
tag = node.tag
64-
attrs = {}
71+
attrs = OrderedDict()
6572
for name, value in list(node.attrib.items()):
6673
match = tag_regexp.match(name)
6774
if match:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy