summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree/ElementTree.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r--Lib/xml/etree/ElementTree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index c47573e..2663b33 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -662,9 +662,9 @@ class ElementTree:
# write XML to file
tag = node.tag
if tag is Comment:
- file.write(b"<!-- " + _encode_cdata(node.text, encoding) + b" -->")
+ file.write(_encode("<!-- %s -->" % node.text, encoding))
elif tag is ProcessingInstruction:
- file.write(b"<?" + _encode_cdata(node.text, encoding) + b"?>")
+ file.write(_encode("<?%s?>" % node.text, encoding))
else:
items = list(node.items())
xmlns_items = [] # new namespaces in this scope