Skip to content
This repository was archived by the owner on Jan 28, 2019. It is now read-only.

Commit 83e8da2

Browse files
committed
etree: only write self-closing <tag/> when element.text is None
like lxml does
1 parent 3ca6320 commit 83e8da2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/ufoLib/etree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def _serialize_xml(write, elem, qnames, namespaces, **kwargs):
415415
else:
416416
v = _escape_attrib(v)
417417
write(' %s="%s"' % (qnames[k], v))
418-
if text or len(elem):
418+
if text is not None or len(elem):
419419
write(">")
420420
if text:
421421
write(_escape_cdata(text))

0 commit comments

Comments
 (0)