compat with newer lxml

This commit is contained in:
Kovid Goyal 2020-12-11 09:05:09 +05:30
parent 12e4912865
commit 9120d3116a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -72,7 +72,7 @@ def _checkExists(filename):
def _formatXml(root):
""" A helper to make the LRS output look nicer. """
for elem in root.getiterator():
for elem in root.iter():
if len(elem) > 0 and (not elem.text or not elem.text.strip()):
elem.text = "\n"
if not elem.tail or not elem.tail.strip():