Simplifying code a bit

This commit is contained in:
José Manuel Barroso Galindo
2022-11-12 15:50:43 +01:00
committed by GitHub
parent 286d8edbdd
commit 58208e245e

View File

@@ -823,10 +823,7 @@ import xml.etree.ElementTree as ET
try:
context = ET.iterparse('${FILE}', events=('start',))
for _, elem in context:
elem_tag = elem.tag.lower()
if elem_tag == 'setname':
if elem.text is None:
continue
if elem.tag.lower() == 'setname' and elem.text is not None:
print('echo %s' % elem.text.strip())
except ET.ParseError as e:
pass