chore: restore typing hint for self.script_readers (#1500)

With future annotations, typing hints resolution is always deferred.

https://peps.python.org/pep-0563/

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
Ihar Hrachyshka 2025-04-30 14:33:27 -04:00 committed by GitHub
parent 4ab7e9ddfb
commit b147331f2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,9 @@
from __future__ import annotations
import logging
from collections.abc import Iterable
from pathlib import Path
from typing import Any, Optional, Type
from typing import Optional, Type
from docling_core.types.doc import BoundingBox, CoordOrigin
from docling_core.types.doc.page import BoundingRectangle, TextCell
@ -39,7 +41,7 @@ class TesseractOcrModel(BaseOcrModel):
self.scale = 3 # multiplier for 72 dpi == 216 dpi.
self.reader = None
self.script_readers: dict[str, Any] = {}
self.script_readers: dict[str, tesserocr.PyTessBaseAPI] = {}
if self.enabled:
install_errmsg = (