Skip to content

Commit

Permalink
Fix tests/test_reader.py::test_issue604
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Dec 28, 2023
1 parent a86b652 commit 9e16b7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
from io import BytesIO
from pathlib import Path
from typing import Union

import pytest

Expand Down Expand Up @@ -695,12 +696,15 @@ def test_issue604(caplog, strict):
]
assert normalize_warnings(caplog.text) == msg

def get_dest_pages(x) -> int:
def get_dest_pages(x) -> Union[int, None]:
if isinstance(x, list):
r = [get_dest_pages(y) for y in x]
return r
else:
return pdf.get_destination_page_number(x) + 1
des_page_number = pdf.get_destination_page_number(x)
if des_page_number is None:
return des_page_number
return des_page_number + 1

out = []

Expand Down

0 comments on commit 9e16b7d

Please sign in to comment.