mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-07-01 06:29:59 +02:00
🐛 Check that we always get a valid ALTO namespace (satifies mypy)
This commit is contained in:
parent
19d1a00817
commit
5d9f0c482f
1 changed files with 1 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue