Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Dec 10, 2022
1 parent b4a03a7 commit 6717709
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions PyPDF2/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def encrypt(
# user_password is only Optional for due to the deprecated user_pwd
raise ValueError("user_password may not be None")

if owner_pwd is not None:
if owner_pwd is not None: # deprecated
if owner_password is not None:
raise ValueError(
"The argument owner_pwd of encrypt is deprecated. Use owner_password only."
Expand Down Expand Up @@ -1239,11 +1239,11 @@ def add_outline_item_destination(
parent: Union[None, TreeObject, IndirectObject] = None,
dest: Union[None, PageObject, TreeObject] = None, # deprecated
) -> IndirectObject:
if page_destination is not None and dest is not None:
if page_destination is not None and dest is not None: # deprecated
raise ValueError(
"The argument dest of add_outline_item_destination is deprecated. Use page_destination only."
)
if dest is not None:
if dest is not None: # deprecated
old_term = "dest"
new_term = "page_destination"
warnings.warn(
Expand Down Expand Up @@ -1457,7 +1457,7 @@ def add_named_destination_object(
raise ValueError(
"The argument dest of add_named_destination_object is deprecated. Use page_destination only."
)
if dest is not None:
if dest is not None: # deprecated
old_term = "dest"
new_term = "page_destination"
warnings.warn(
Expand All @@ -1466,7 +1466,7 @@ def add_named_destination_object(
)
)
page_destination = dest
if page_destination is None:
if page_destination is None: # deprecated
raise ValueError("page_destination may not be None")

page_destination_ref = self._add_object(page_destination)
Expand Down

0 comments on commit 6717709

Please sign in to comment.