Skip to content

Commit

Permalink
fix type check
Browse files Browse the repository at this point in the history
  • Loading branch information
unsleepy22 committed Feb 10, 2025
1 parent 43a3ea6 commit 8c743a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions trafilatura/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,12 @@ def is_last_element_in_cell(elem: _Element) -> bool:
return False

if elem.tag == "cell":
children = list(elem)
children = elem.getchildren()
return not children or children[-1] == elem
elif is_in_table_cell(elem):
children = list(elem.getparent())
parent = elem.getparent()
if parent is None:
return False

Check warning on line 481 in trafilatura/utils.py

View check run for this annotation

Codecov / codecov/patch

trafilatura/utils.py#L481

Added line #L481 was not covered by tests
children = parent.getchildren()
return not children or children[-1] == elem
return False

Check warning on line 484 in trafilatura/utils.py

View check run for this annotation

Codecov / codecov/patch

trafilatura/utils.py#L484

Added line #L484 was not covered by tests

0 comments on commit 8c743a5

Please sign in to comment.