Skip to content

Commit 59b243e

Browse files
committed
fix for python < 3.12
Signed-off-by: Michele Dolfi <[email protected]>
1 parent e32f77f commit 59b243e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docling_core/utils/legacy.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,11 @@ def _transform_prov(item: BaseCell) -> Optional[ProvenanceItem]:
519519
else:
520520
label = DocItemLabel.TEXT
521521
normalized_label_name = label_name.replace("-", "_")
522-
if (
523-
normalized_label_name is not None
524-
and normalized_label_name in DocItemLabel
525-
):
526-
label = DocItemLabel(normalized_label_name)
522+
if normalized_label_name is not None:
523+
try:
524+
label = DocItemLabel(normalized_label_name)
525+
except ValueError:
526+
pass
527527
doc.add_text(label=label, text=text, prov=prov)
528528

529529
elif isinstance(item, DsSchemaTable):

0 commit comments

Comments
 (0)