Ver código fonte

fixed 'None' dictionnary

Florian 7 anos atrás
pai
commit
815d95687b
1 arquivos alterados com 2 adições e 0 exclusões
  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