Skip to content

Commit

Permalink
πŸ› Check that we always get a valid ALTO namespace (satifies mypy)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegerber committed Mar 27, 2024
1 parent 19d1a00 commit 5d9f0c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/dinglehopper/ocr_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def alto_namespace(tree: ET._ElementTree) -> Optional[str]:
"""
root_name = ET.QName(tree.getroot().tag)
if root_name.localname == "alto":
assert isinstance(root_name.namespace, str)
return root_name.namespace
else:
raise ValueError("Not an ALTO tree")
Expand Down

0 comments on commit 5d9f0c4

Please sign in to comment.