From cdb00e9ef8d6e97bc8d42f781b026267c73d91d1 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 21 Mar 2011 16:07:45 +0100 Subject: [PATCH] Do not write empty tag attributes. --- linkcheck/logger/customxml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linkcheck/logger/customxml.py b/linkcheck/logger/customxml.py index c59f5569..c3569ff9 100644 --- a/linkcheck/logger/customxml.py +++ b/linkcheck/logger/customxml.py @@ -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"):