Skip to content

Commit

Permalink
toxml - Treat bool type differently
Browse files Browse the repository at this point in the history
  • Loading branch information
ygalblum committed Mar 6, 2020
1 parent c0df056 commit b219009
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cterasdk/convert/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def toxml(obj):
q.put(root)
while not q.empty():
item = q.get()
if isinstance(item.obj, (str, int, float, complex)):
if isinstance(item.obj, (str, int, float, complex, bool)):
item.node = CreateElement(item.parent, XMLTypes.VAL)
item.node.text = str(item.obj)
elif isinstance(item.obj, bool):
item.node = CreateElement(item.parent, XMLTypes.VAL)
item.node.text = str(item.obj).lower()
if isinstance(item.obj, bool):
item.node.text = str(item.obj).lower()
else:
item.node.text = str(item.obj)
elif isinstance(item.obj, list):
item.node = CreateElement(item.parent, XMLTypes.LIST)
for member in item.obj:
Expand Down

0 comments on commit b219009

Please sign in to comment.