Skip to content

Commit

Permalink
Improved is_empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sgeulette committed Jan 3, 2024
1 parent 65a6d35 commit 5e04fcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imio/pyutils/bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def is_empty(element):
:param element: bs item
:return: Bool value (True is empty)
"""
return len(element.get_text(strip=True)) == 0 and not len([ch for ch in element.children if ch.strip()])
return len(element.get_text(strip=True)) == 0 and not len([ch for ch in element.children if str(ch).strip()])


def remove_attributes(element, attributes=[], recursive=True):
Expand Down

0 comments on commit 5e04fcd

Please sign in to comment.