X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fsp%2Fcons.py;h=205de0355c3c912fdfba6d5d41d451261f407714;hb=199cdc4055921d7497e5a6b9a132ac44d04e9894;hp=74a6ea6e30830ad324be9a51ee15beda2bc0fec8;hpb=fd7af0a278cf6a58b8ea371e3e84c99c1cb77e0c;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()