Merge branch 'master' of ansgar.seatribe.se:/usr/local/src/wrw
[wrw.git] / wrw / sp / cons.py
index 8ffa397..d8b30a8 100644 (file)
@@ -1,4 +1,4 @@
-import sys, collections.abc
+import sys, collections
 import xml.dom.minidom
 
 class node(object):
@@ -63,12 +63,12 @@ class context(object):
             return
         new = self.nodefrom(child)
         if new is not None:
-            node.children.append(self.nodefrom(child))
-        elif isinstance(child, collections.abc.Iterable):
+            node.children.append(new)
+        elif isinstance(child, collections.Iterable):
             for ch in child:
                 self.addchild(node, ch)
         else:
-            raise Exception("No node conversion known for %s objects" % str(type(ob)))
+            raise Exception("No node conversion known for %s objects" % str(type(child)))
 
     def addattr(self, node, k, v):
         if v is not None: