mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-08-11 02:29:55 +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)
|
root_name = ET.QName(tree.getroot().tag)
|
||||||
if root_name.localname == "alto":
|
if root_name.localname == "alto":
|
||||||
|
assert isinstance(root_name.namespace, str)
|
||||||
return root_name.namespace
|
return root_name.namespace
|
||||||
else:
|
else:
|
||||||
raise ValueError("Not an ALTO tree")
|
raise ValueError("Not an ALTO tree")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue