summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorDiego Rojas <rojastorrado@gmail.com>2018-11-07 14:09:04 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-11-07 14:09:04 (GMT)
commit5598cc90c745dab827e55fadded42dbe85e31d33 (patch)
tree9bda930fd528affec3133a00711a069153f71fd2 /Lib/xml
parentf19447994983902aa88362d8fffe645f1ea2f2aa (diff)
downloadcpython-5598cc90c745dab827e55fadded42dbe85e31d33.zip
cpython-5598cc90c745dab827e55fadded42dbe85e31d33.tar.gz
cpython-5598cc90c745dab827e55fadded42dbe85e31d33.tar.bz2
bpo-34160: Preserve order of attributes in minidom. (GH-10219)
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/dom/minidom.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index e44e04a..469c517 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -854,9 +854,8 @@ class Element(Node):
writer.write(indent+"<" + self.tagName)
attrs = self._get_attributes()
- a_names = sorted(attrs.keys())
- for a_name in a_names:
+ for a_name in attrs.keys():
writer.write(" %s=\"" % a_name)
_write_data(writer, attrs[a_name].value)
writer.write("\"")