Mercurial > genshi > genshi-test
diff genshi/template/directives.py @ 347:c0a4114786cc experimental-inline
cspeedups branch: Merged [423:426/trunk].
author | cmlenz |
---|---|
date | Fri, 10 Nov 2006 17:38:50 +0000 |
parents | eb4ef44ea1ad |
children | 0fc758cb3a02 |
line wrap: on
line diff
--- a/genshi/template/directives.py +++ b/genshi/template/directives.py @@ -80,7 +80,6 @@ kind, (tag, attrib), pos = stream.next() attrs = self.expr.evaluate(ctxt) if attrs: - attrib = Attrs(attrib[:]) if isinstance(attrs, Stream): try: attrs = iter(attrs).next() @@ -88,11 +87,9 @@ attrs = [] elif not isinstance(attrs, list): # assume it's a dict attrs = attrs.items() - for name, value in attrs: - if value is None: - attrib.remove(name) - else: - attrib.set(name, unicode(value).strip()) + attrib -= [name for name, val in attrs if val is None] + attrib |= [(name, unicode(val).strip()) for name, val in attrs + if val is not None] yield kind, (tag, attrib), pos for event in stream: yield event