Skip to content

Commit 4afaf6e

Browse files
committed
Fix a condition was throwing exceptions when storing floats to XML ElementTree.text element.
1 parent 2a44490 commit 4afaf6e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

PyFePA/serializer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ def serializexml(invoice_part,tagname):
146146
for t in taglist[k]['value']:
147147
fe.append(serializexml(t, taglist[k]['tag']))
148148
elif taglist[k]['type'] == 'S' and taglist[k]['value'] is not None:
149+
if type(taglist[k]['value']) != unicode:
150+
taglist[k]['value'] = unicode(taglist[k]['value'])
149151
(ElementTree.SubElement(fe, taglist[k]['tag'])).text = taglist[k]['value']
150152
elif taglist[k]['type'] == 'O' and taglist[k]['value'] is not None:
151153
fe.append(serializexml(taglist[k]['value'],taglist[k]['tag']))

0 commit comments

Comments
 (0)