Mercurial > genshi > genshi-test
diff genshi/template/directives.py @ 907:bb813ef5fe25 experimental-inline
inline branch: merged r1129 from trunk.
author | cmlenz |
---|---|
date | Wed, 28 Apr 2010 21:36:59 +0000 |
parents | 09cc3627654c |
children |
line wrap: on
line diff
--- a/genshi/template/directives.py +++ b/genshi/template/directives.py @@ -175,9 +175,10 @@ attrs = [] elif not isinstance(attrs, list): # assume it's a dict attrs = attrs.items() - attrib -= [name for name, val in attrs if val is None] - attrib |= [(QName(name), unicode(val).strip()) for name, val - in attrs if val is not None] + attrib |= [ + (QName(n), v is not None and unicode(v).strip() or None) + for n, v in attrs + ] yield kind, (tag, attrib), pos for event in stream: yield event