Fix bug 725478 because we run a buggy Python released almost 5 years ago; r=tigerblood

This commit is contained in:
Gregory Szorc 2012-02-27 16:15:59 -08:00
Родитель 48c8e8a527
Коммит f30f25a1ba
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -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)