X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fsp%2Fcons.py;h=205de0355c3c912fdfba6d5d41d451261f407714;hb=d38b200493b3ed263dbf10581d6d204462ed68c4;hp=74a6ea6e30830ad324be9a51ee15beda2bc0fec8;hpb=8d8d1f703090499006efeb51299b8a267b00aa09;p=wrw.git diff --git a/wrw/sp/cons.py b/wrw/sp/cons.py index 74a6ea6..205de03 100644 --- a/wrw/sp/cons.py +++ b/wrw/sp/cons.py @@ -59,10 +59,11 @@ class context(object): node.children.append(self.nodefrom(child)) def addattr(self, node, k, v): - node.attrs[str(k)] = str(v) + if v is not None: + node.attrs[str(k)] = str(v) class constructor(object): - def __init__(self, ns, elcls = element, ctx=None): + def __init__(self, ns, elcls=element, ctx=None): self._ns = ns self._elcls = elcls if ctx is None: ctx = context()