Allow noop-adding of None objects.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 26 Dec 2013 07:43:08 +0000 (08:43 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 26 Dec 2013 07:43:08 +0000 (08:43 +0100)
wrw/sp/cons.py

index 1e3d678..ff6a1b1 100644 (file)
@@ -60,6 +60,8 @@ class context(object):
         raise Exception("No node conversion known for %s objects" % str(type(ob)))
 
     def addchild(self, node, child):
+        if child is None:
+            return
         node.children.append(self.nodefrom(child))
 
     def addattr(self, node, k, v):