Do not write empty tag attributes.

This commit is contained in:
Bastian Kleineidam 2011-03-21 16:07:45 +01:00
parent 900fc38f6a
commit cdb00e9ef8

View file

@ -72,7 +72,9 @@ class CustomXMLLogger (xmllog.XMLLogger):
if url_data.warnings and self.has_part('warning'):
self.xml_starttag(u"warnings")
for tag, data in url_data.warnings:
attrs = {"tag": tag}
attrs = {}
if tag:
attrs["tag"] = tag
self.xml_tag(u"warning", data, attrs)
self.xml_endtag(u"warnings")
if self.has_part("result"):