Fix bug 725478 because we run a buggy Python released almost 5 years ago; r=tigerblood
☠☠ backed out by 269bd7e1444e ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Mon, 27 Feb 2012 16:15:59 -0800
changeset 87887 88d02a07d390
parent 87886 7db039c3f3e2
child 87888 9a3da4d27d13
push id22160
push usermbrubeck@mozilla.com
push dateTue, 28 Feb 2012 17:21:33 +0000
treeherdermozilla-central@dde4e0089a18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstigerblood
bugs725478
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix bug 725478 because we run a buggy Python released almost 5 years ago; r=tigerblood
testing/xpcshell/runxpcshelltests.py
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -458,20 +458,24 @@ class XPCShellTests(object):
         # It appears most tools expect the time attribute to be present.
         testcase.setAttribute("time", "0")
 
       if "failure" in result:
         failure = doc.createElement("failure")
         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)
 
       if result.get("skipped", None):
         e = doc.createElement("skipped")
         testcase.appendChild(e)