Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pypdf/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ def _merge_page(
return self._merge_page_writer(
page2, page2transformation, ctm, over, expand
)
return None
except (AssertionError, AttributeError):
pass

Expand Down Expand Up @@ -1179,6 +1180,7 @@ def _merge_page(
self.replace_contents(ContentStream(new_content_array, self.pdf))
self[NameObject(PG.RESOURCES)] = new_resources
self[NameObject(PG.ANNOTS)] = new_annots
return None

def _merge_page_writer(
self,
Expand Down
2 changes: 2 additions & 0 deletions pypdf/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,7 @@ def clean_forms(

clean(content, images, forms, text_filters)
page.replace_contents(content)
return [], [] # type: ignore

def remove_images(
self,
Expand Down Expand Up @@ -3213,6 +3214,7 @@ def find_outline_item(
o = cast(TreeObject, o["/Next"])
else:
return None
return None # This line may be unreachable?

def find_bookmark(
self,
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ ignore = [
"PT014", # Ruff bug: Duplicate of test case at index 1 in `@pytest_mark.parametrize`
"PTH123", # `open()` should be replaced by `Path.open()`
"PYI042", # Type alias `mode_str_type` should be CamelCase
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RUF001", # Detect confusable Unicode-to-Unicode units. Introduces bugs
"RUF002", # Detect confusable Unicode-to-Unicode units. Introduces bugs
"S101", # Use of `assert` detected
Expand Down
Loading