mini improvement to simple_sgml_tag: ignore attributes for which the value is None tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 19 Feb 2009 21:32:23 +0100
branchtls-sprint
changeset 862 ee560986e211
parent 861 7985b5db2284
child 863 4fde01fc39ca
mini improvement to simple_sgml_tag: ignore attributes for which the value is None
common/uilib.py
--- a/common/uilib.py	Thu Feb 19 21:31:18 2009 +0100
+++ b/common/uilib.py	Thu Feb 19 21:32:23 2009 +0100
@@ -210,7 +210,8 @@
     value = u'<%s' % tag
     if attrs:
         value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value)))
-                                  for attr, value in attrs.items())
+                                  for attr, value in attrs.items()
+                                  if value is not None)
     if content:
         value += u'>%s</%s>' % (html_escape(unicode(content)), tag)
     else: