Skip to content

Commit

Permalink
Use Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Jan 9, 2024
1 parent e9962b3 commit 06e79d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pypdf/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ def _layout_mode_text(
space_vertically: bool = True,
scale_weight: float = 1.25,
strip_rotated: bool = True,
debug_path: Union[Path, None] = None,
debug_path: Optional[Path] = None,
) -> str:
"""
Get text preserving fidelity to source PDF text layout.
Expand Down
6 changes: 3 additions & 3 deletions pypdf/_text_extraction/_layout_mode/_fixed_width_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from itertools import groupby
from math import ceil
from pathlib import Path
from typing import Any, Dict, Iterator, List, Tuple, Union
from typing import Any, Dict, Iterator, List, Optional, Tuple

from ..._utils import logger_warning
from .. import LAYOUT_NEW_BT_GROUP_SPACE_WIDTHS
Expand Down Expand Up @@ -203,7 +203,7 @@ def recurs_to_target_op(


def y_coordinate_groups(
bt_groups: List[BTGroup], debug_path: Union[Path, None] = None
bt_groups: List[BTGroup], debug_path: Optional[Path] = None
) -> Dict[int, List[BTGroup]]:
"""
Group text operations by rendered y coordinate, i.e. the line number.
Expand Down Expand Up @@ -253,7 +253,7 @@ def text_show_operations(
ops: Iterator[Tuple[List[Any], bytes]],
fonts: Dict[str, Font],
strip_rotated: bool = True,
debug_path: Union[Path, None] = None,
debug_path: Optional[Path] = None,
) -> List[BTGroup]:
"""
Extract text from BT/ET operator pairs.
Expand Down

0 comments on commit 06e79d3

Please sign in to comment.