changeset 499:79a422aeae7e

If an empty string is present as a child, writing to XML fails without this patch
author dfraser
date Thu, 09 Oct 2008 14:53:47 +0000
parents 17ad4028ba14
children 6a9268d10d09
files bitten/util/xmlio.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/util/xmlio.py
+++ b/bitten/util/xmlio.py
@@ -76,7 +76,7 @@
             if isinstance(child, (Element, ParsedElement)):
                 child.write(out, newlines=newlines)
             else:
-                if child[0] == '<':
+                if child.startswith('<'):
                     out.write('<![CDATA[' + child + ']]>')
                 else:
                     out.write(_escape_text(child))
Copyright (C) 2012-2017 Edgewall Software