mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46:13 +01:00
Merge pull request #1318 from dmach/fix-xmlindent-elementtree
Fix core.xmlindent() to work with ElementTree objects
This commit is contained in:
commit
f224926125
@ -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