Skip to content

Commit

Permalink
Replaced Element boolean value by testing its length
Browse files Browse the repository at this point in the history
Hanldes deprecation of ElementTree.Element.__bool__
  • Loading branch information
tcalmant committed Aug 22, 2024
1 parent 16bed41 commit 6ea1775
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pelix/rsa/edef.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _indent(self, element: ElementTree.Element, level: int = 0, prefix: str = "\
"""
element_prefix = "\n{0}".format(level * prefix)

if element:
if len(element) != 0:
if not element.text or not element.text.strip():
element.text = element_prefix + prefix

Expand Down

0 comments on commit 6ea1775

Please sign in to comment.