mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46:13 +01:00
Fix core.xmlindent() to work with ElementTree objects
This commit is contained in:
parent
ba1b3c791b
commit
c8f2ae1ae6
@ -636,6 +636,8 @@ class DirectoryServiceinfo:
|
||||
|
||||
def xmlindent(elem, level=0):
|
||||
i = "\n" + level * " "
|
||||
if isinstance(elem, ET.ElementTree):
|
||||
elem = elem.getroot()
|
||||
if len(elem):
|
||||
if not elem.text or not elem.text.strip():
|
||||
elem.text = i + " "
|
||||
|
Loading…
Reference in New Issue
Block a user