diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index 2ea24738fd74..b54575893d90 100644 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -463,10 +463,14 @@ class XPCShellTests(object): failure.setAttribute("type", str(result["failure"]["type"])) failure.setAttribute("message", result["failure"]["message"]) - # Lossy translation but required to not break CDATA. + # Lossy translation but required to not break CDATA. Also, text could + # be None and Python 2.5's minidom doesn't accept None. Later versions + # do, however. cdata = result["failure"]["text"] - if cdata is not None: - cdata = cdata.replace("]]>", "]] >") + if not isinstance(cdata, str): + cdata = "" + + cdata = cdata.replace("]]>", "]] >") text = doc.createCDATASection(cdata) failure.appendChild(text) testcase.appendChild(failure)