Florian 6 лет назад
Родитель
Сommit
815d95687b
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      plan_gen.py

+ 2 - 0
plan_gen.py

@@ -37,6 +37,8 @@ def rand_person(nodes):
 def create_child(parent_node, child_name, child_attrs=None):
     ''' creates an xml child element and set its attributes '''
     child = etree.SubElement(parent_node, child_name)
+    if child_attrs is None:
+        return child
     for attr, value in child_attrs.items():
         child.set(attr, value)
     return child