Issue #1390: Raise ValueError in toxml when an invalid comment would
otherwise be produced.
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index ae96033..02e82d9 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -1128,6 +1128,8 @@
         self.data = self.nodeValue = data
 
     def writexml(self, writer, indent="", addindent="", newl=""):
+        if "--" in self.data:
+            raise ValueError("'--' is not allowed in a comment node")
         writer.write("%s<!--%s-->%s" % (indent, self.data, newl))