summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorVladimir Surjaninov <vsurjaninov@gmail.com>2019-03-27 05:58:49 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-03-27 05:58:49 (GMT)
commit384b81d923addd52125e94470b11d2574ca266a9 (patch)
treeb0482ea447e6a9123c9e6f46fffaf8edb49faa51 /Lib/xml
parentf760610bddd7e8f8ac0914d5d59ef806bc16a73b (diff)
downloadcpython-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.py3
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)