diff options
author | Vladimir Surjaninov <vsurjaninov@gmail.com> | 2019-03-27 05:58:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-03-27 05:58:49 (GMT) |
commit | 384b81d923addd52125e94470b11d2574ca266a9 (patch) | |
tree | b0482ea447e6a9123c9e6f46fffaf8edb49faa51 /Lib/xml | |
parent | f760610bddd7e8f8ac0914d5d59ef806bc16a73b (diff) | |
download | cpython-384b81d923addd52125e94470b11d2574ca266a9.zip cpython-384b81d923addd52125e94470b11d2574ca266a9.tar.gz cpython-384b81d923addd52125e94470b11d2574ca266a9.tar.bz2 |
bpo-36407: Fix writing indentations of CDATA section (xml.dom.minidom). (GH-12514)
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/dom/minidom.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 43569dd..464420b 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -862,7 +862,8 @@ class Element(Node): if self.childNodes: writer.write(">") if (len(self.childNodes) == 1 and - self.childNodes[0].nodeType == Node.TEXT_NODE): + self.childNodes[0].nodeType in ( + Node.TEXT_NODE, Node.CDATA_SECTION_NODE)): self.childNodes[0].writexml(writer, '', '', '') else: writer.write(newl) |