Skip to content

Commit 06e79d3

Browse files
committed
Use Optional
1 parent e9962b3 commit 06e79d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pypdf/_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ def _layout_mode_text(
19151915
space_vertically: bool = True,
19161916
scale_weight: float = 1.25,
19171917
strip_rotated: bool = True,
1918-
debug_path: Union[Path, None] = None,
1918+
debug_path: Optional[Path] = None,
19191919
) -> str:
19201920
"""
19211921
Get text preserving fidelity to source PDF text layout.

pypdf/_text_extraction/_layout_mode/_fixed_width_page.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from itertools import groupby
55
from math import ceil
66
from pathlib import Path
7-
from typing import Any, Dict, Iterator, List, Tuple, Union
7+
from typing import Any, Dict, Iterator, List, Optional, Tuple
88

99
from ..._utils import logger_warning
1010
from .. import LAYOUT_NEW_BT_GROUP_SPACE_WIDTHS
@@ -203,7 +203,7 @@ def recurs_to_target_op(
203203

204204

205205
def y_coordinate_groups(
206-
bt_groups: List[BTGroup], debug_path: Union[Path, None] = None
206+
bt_groups: List[BTGroup], debug_path: Optional[Path] = None
207207
) -> Dict[int, List[BTGroup]]:
208208
"""
209209
Group text operations by rendered y coordinate, i.e. the line number.
@@ -253,7 +253,7 @@ def text_show_operations(
253253
ops: Iterator[Tuple[List[Any], bytes]],
254254
fonts: Dict[str, Font],
255255
strip_rotated: bool = True,
256-
debug_path: Union[Path, None] = None,
256+
debug_path: Optional[Path] = None,
257257
) -> List[BTGroup]:
258258
"""
259259
Extract text from BT/ET operator pairs.

0 commit comments

Comments
 (0)