[FIX]XML Base for Python2
This commit is contained in:
parent
73ecdb19b5
commit
71475e3f27
@ -36,7 +36,7 @@ def xmlroot(tree):
|
||||
def xmlchild(parent, children):
|
||||
""" Handling of children (ie non root) XML Nodes with/o text and
|
||||
subchildren (recursive) """
|
||||
if isinstance(children, str):
|
||||
if isinstance(children, basestring):
|
||||
parent.text = children
|
||||
elif isinstance(children, XMLDictElement):
|
||||
attrs = {str(k): str(v) for [k, v] in children.attrs.items()}
|
||||
@ -55,7 +55,7 @@ def xmln(tag='', attrs={}, children=[]):
|
||||
children = attrs
|
||||
attrs = {}
|
||||
xmldictel = partial(XMLDictElement, tag, attrs)
|
||||
if isinstance(children, str):
|
||||
if isinstance(children, basestring):
|
||||
return xmldictel([children])
|
||||
if isinstance(children, list):
|
||||
return xmldictel(children)
|
||||
|
Loading…
x
Reference in New Issue
Block a user